vanhunk
09-05-2014, 07:29 AM
Automatically saving workbook containing macros as a macro-free workbook:
I have a workbook that contains buttons and macros. I run a macro that populates this workbook with data from other workbooks and then save it without buttons and as a macro-free workbook.
However, when it gets to the “saving as” bit I get the following message box with options “Yes”, “No” and “Help”. I want to avoid this prompt and the option to save it in another format by always, automatically choosing the “Yes” option. Can this be done?
I get the following prompt:
The following features cannot be saved in macro-free workbooks:
· VB project
To save a file with these features, click No, and then choose a macro-enabled file type in the File Type list.
To continue saving as a macro-free workbook, click Yes.
'FileFormat 51 = xlOpenXMLWorkbook( without macros in 2007-2013):
ActiveWorkbook.SaveAs FileName:=NewBookName, _
FileFormat:=51, _
PassWord:="", _
WriteResPassword:="", _
ReadOnlyRecommended:=False, _
CreateBackup:=False
Best regards,
vanhunk
I have a workbook that contains buttons and macros. I run a macro that populates this workbook with data from other workbooks and then save it without buttons and as a macro-free workbook.
However, when it gets to the “saving as” bit I get the following message box with options “Yes”, “No” and “Help”. I want to avoid this prompt and the option to save it in another format by always, automatically choosing the “Yes” option. Can this be done?
I get the following prompt:
The following features cannot be saved in macro-free workbooks:
· VB project
To save a file with these features, click No, and then choose a macro-enabled file type in the File Type list.
To continue saving as a macro-free workbook, click Yes.
'FileFormat 51 = xlOpenXMLWorkbook( without macros in 2007-2013):
ActiveWorkbook.SaveAs FileName:=NewBookName, _
FileFormat:=51, _
PassWord:="", _
WriteResPassword:="", _
ReadOnlyRecommended:=False, _
CreateBackup:=False
Best regards,
vanhunk