Hi,
I have written one macro which will change background color of some of the rows of one excel file, and save it with the changes. This excel file is having some macros which will run automatically every time we open this. That means it is a micro enabled sheet (.xlsm). But while saving it, with below code:
Application.DisplayAlerts = False
Application.ScreenUpdating = False
objExcelSrc.ActiveWorkbook.SaveAs fileName:= _
MrkSrcFile, FileFormat:= _
xlOpenXMLWorkbook, CreateBackup:=False
one “Microsoft Excel” error message is displaying. The error message says:
“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 micro – free workbook, Click Yes”.
If I click “Yes”, my macro is running fine. If NO, it’s asking to change the format and save it manually.
So, I have two options to suppress the message or to click the default option Yes so that my macro will run. But I am not able to handle this with the below two options.
Below are the codes I have already tried, but not able to handle. Please guide me on this.
'---control moving out
'objExcelSrc.ActiveWorkbook.SaveAs fileName:= _
'MrkSrcFile, FileFormat:= _
'xlOpenXMLWorkbookMacroEnabled, CreateBackup:=False
'---control moving out
'objExcelSrc.ActiveWorkbook.SaveAs fileName:=
'MrkSrcFile , FileFormat:= _
'xlOpenXMLWorkbookMacroDisabled, CreateBackup:=False
'---control moving out
'objExcelSrc.ActiveWorkbook.SaveAs fileName:= _
'MrkSrcFile, CreateBackup:=False
'Application.DisplayAlerts = True
'currentWorkSheetSrc.SaveAs MrkSrcFile
'Application.DisplayAlerts = False
'currentWorkSheetSrc.SaveAs fileName:= _
'MrkSrcFile, FileFormat:= _
'xlOpenXMLWorkbook, CreateBackup:=False
'--51 pop ups,56-hang,50-not working
'objExcelSrc.ActiveWorkbook.SaveAs fileName:= _
'MrkSrcFile, FileFormat:=FileFormatNum, CreateBackup:=False
currentWorkSheetSrc.Application.Quit
'MsgBox (j)
Application.ScreenUpdating = True
Thanks
Amarendra