当我按下按钮时,我有一个自动保存在新文件夹中的代码;代码工作正常但兼容性检查器在允许保存之前出现。有没有办法禁用这个兼容性检查器,以便使用自动保存按钮的人不会感到困惑?
这是我的代码:
Sub FILESAVE()
ActiveWorkbook.SaveAs Filename:="H:\Digital Production Control and Tally Sheet Library\ " & Range("'Production Control Sheet'!B2") & _
Format(Now(), " mm-dd-yyyy hh-mm AMPM"), FileFormat:=xlNormal, Password:="", _
WriteResPassword:="kpqual", ReadOnlyRecommended:=True, CreateBackup:=False
End Sub
它可以创造奇迹,但我不知道如何为问题禁用兼容性检查器。
答案 0 :(得分:1)
试试这个并告诉我它是否有效:
Sub FILESAVE()
' http://msdn.microsoft.com/en-us/library/gg132972(v=office.14).aspx
'51 = xlOpenXMLWorkbook (without macro's in 2007-2013, xlsx)
'52 = xlOpenXMLWorkbookMacroEnabled (with or without macro's in 2007-2013, xlsm)
'50 = xlExcel12 (Excel Binary Workbook in 2007-2013 with or without macro's, xlsb)
'56 = xlExcel8 (97-2003 format in Excel 2007-2013, xls)
' See more info on http://www.rondebruin.nl/win/s5/win001.htm
ActiveWorkbook.SaveAs Filename:="H:\Digital Production Control and Tally Sheet Library\ " & Range("'Production Control Sheet'!B2") & _
Format(Now(), " mm-dd-yyyy hh-mm AMPM"), FileFormat:=52, Password:="", _
WriteResPassword:="kpqual", ReadOnlyRecommended:=True, CreateBackup:=False
End Sub