miauwington
New Member
- Joined
- Sep 9, 2014
- Messages
- 9
Hi folks,
I've created an excel template for my colleagues that relies heavily on macro's.
In the Add-ons menu I've created a "save" button that makes sure people save the xltm as an xlsm during first use.
The code for the save procedure is the following :
The issue I'm facing is that after saving the file to xlsm the macro's don't work anymore (the error when clicking a macro indicates that excel looks for the macro's in an xlsx version of the file. Which does not exist. Nor did I use xlsx anywhere in my code.).
If the user closes the (now) xlsm file and reopens it, macro's work again. How can I avoid that the user has to reopen the file after saving it the first time ? All later use of the xlsm file is without issues. This only happens when it was first saved from xltm to xlsm.
Excel 2013, Windows 7
Thank you !
Regards, Miauw
I've created an excel template for my colleagues that relies heavily on macro's.
In the Add-ons menu I've created a "save" button that makes sure people save the xltm as an xlsm during first use.
The code for the save procedure is the following :
Code:
strFullPath = "X:\Project\" & strWerfnummer & "\03_Werfdocumenten\08_Verrekeningsvoorstellen\VV"fileSaveName = Application.GetSaveAsFilename( _
InitialFileName:=strFullPath, _
fileFilter:="Excel Files (*.xlsm), *.xlsm")
ActiveWorkbook.SaveAs fileSaveName, FileFormat:=xlOpenXMLWorkbookMacroEnabled
The issue I'm facing is that after saving the file to xlsm the macro's don't work anymore (the error when clicking a macro indicates that excel looks for the macro's in an xlsx version of the file. Which does not exist. Nor did I use xlsx anywhere in my code.).
If the user closes the (now) xlsm file and reopens it, macro's work again. How can I avoid that the user has to reopen the file after saving it the first time ? All later use of the xlsm file is without issues. This only happens when it was first saved from xltm to xlsm.
Excel 2013, Windows 7
Thank you !
Regards, Miauw