The excel form I'm using is being used for data entry purposes. I've created a button to automate saving and closing excel. The code looks like this:
Sub Save_Close()
If MsgBox("Are you sure you want to Exit now?", vbYesNo) = vbNo Then Exit Sub
ActiveWorkbook.SaveAs Filename:="O:\Bellingham\Intranet\Production\Reports\Bagging Line Glaze Monitoring\" & Range("D11") & "_" & Range("D5") & "_" & Format(Now(), "YYYYMMDDhhmmss") & ".xlsm"
Application.Quit
End Sub
it was working great until I saved the workbook as a template (.xltm). Now every time the button is pressed I get a message box that says:
The following features cannot be saved in macro-free workbooks:
*VP 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
If I press yes then I get the following error:
Run time error '1004'
This extension can not be used with the selected file type. Change the file extension in the File name text box or select a different file type by changing the save as type.
It seems odd to me that I'm getting this message despite the code I'm using specifying to save the work book as macro enabled (.xlsm).
Does anyone have any idea why this might be happening here?
Thanks
Bruce
Bookmarks