Set wkbone = Workbooks.Open(filePath)
Set sh = wkbone.Sheets(1)
Set sh.Visible = -xlSheetHidden '出错
sh.Application.Visible = False '会将操作的EXcel也隐藏了.
6 个解决方案
#1
wkbone.visible = false
#2
Sub test()
Dim wkb As Workbook
Set wkb = Workbooks.Open(Filename:="sx.xlsx")
wkb.Windows(1).Visible = False
End Sub
#3
唉,两位给出的都不行啊.
#4
不会吧,可是测试过的。楼主需要将参数filename换成你自己的路径和文件名。
#5
我晕.还是会闪一闪的.
#6
加句 application.ScreenUpdating=false
#1
wkbone.visible = false
#2
Sub test()
Dim wkb As Workbook
Set wkb = Workbooks.Open(Filename:="sx.xlsx")
wkb.Windows(1).Visible = False
End Sub
#3
唉,两位给出的都不行啊.
#4
不会吧,可是测试过的。楼主需要将参数filename换成你自己的路径和文件名。
#5
我晕.还是会闪一闪的.
#6
加句 application.ScreenUpdating=false