楼主:
kcyy (嫑槑)
2018-10-16 18:54:52软件:EXCEL
版本:2010
请教大神,
我要将EXCEL档另存成unicode档,使用下列程式码,执行时会有一个问题
如果将VBA程式码设密码保护
https://imgur.com/lX0c6WG.jpg
就会出现如下错误
https://imgur.com/xQRJFzN.jpg
但是VBA程式码如果解开密码保护,就能正确存盘,
请问要如何调整,才能不解开VBA程式码的密码,也能正确存盘呢?
谢谢
XPath = Application.ActiveWorkbook.Path
Application.ScreenUpdating = False
Application.DisplayAlerts = False
Application.ActiveWorkbook.SaveAs Filename:=XPath & "\test.txt", _
FileFormat:=xlUnicodeText, CreateBackup:=False
Application.DisplayAlerts = True
Application.ScreenUpdating = True