Foxtable(狐表)用户栏目专家坐堂 → EXCEL模板打印后窗口无法关闭


  共有2220人关注过本帖树形打印复制链接

主题:EXCEL模板打印后窗口无法关闭

帅哥哟,离线,有人找我吗?
有点甜
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2019/5/13 16:55:00 [显示全部帖子]

Dim App As New MSExcel.Application
Dim Wb As MSExcel.WorkBook = App.WorkBooks.Open("c:\aaa.xls")
Dim Ws As MSExcel.WorkSheet = Wb.WorkSheets(1)
With Ws.PageSetup
    .LeftMargin = 2
    .RightMargin = 2
    .TopMargin = 1
    .BottomMargin = 1
    .CenterHorizontally = True
    .CenterVertically = True
    .Zoom = False
    .FitToPagesTall = 1
End With
wb.saved = True
app.DisplayAlerts = False

Ws.PrintOut (Copies:= 3)  
Wb.Close
App.Quit


 回到顶部