Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
xltm saveas xlsm
I have the following code within an "xltm" file which I want to then save as
"xlsm": Do fName = Application.GetSaveAsFilename(InitialFileName:="ku pa", filefilter:= _ " Excel Macro Enabled Workbook (*.xlsm), *.xlsm,") Loop Until fName < False ActiveWorkbook.SaveAs Filename:=fName I get ERROR on last statement. How can I add "FileFormatValue = 52" to save the file as a "MacroEnabled" thanks |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
xltm saveas xlsm
Did you try adding FileFormat:= xlOpenXMLWorkbookMacroEnabled to the save
statement? HTH Bob "Helmut" wrote in message ... I have the following code within an "xltm" file which I want to then save as "xlsm": Do fName = Application.GetSaveAsFilename(InitialFileName:="ku pa", filefilter:= _ " Excel Macro Enabled Workbook (*.xlsm), *.xlsm,") Loop Until fName < False ActiveWorkbook.SaveAs Filename:=fName I get ERROR on last statement. How can I add "FileFormatValue = 52" to save the file as a "MacroEnabled" thanks |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
xltm saveas xlsm
Bob, YES, I did try that too. It seems no matter what I add, it is ignored
and it gives me error that it cannot save a file with macro in non-macro extension and saves it without macro and without extension. Help "Bob Phillips" wrote: Did you try adding FileFormat:= xlOpenXMLWorkbookMacroEnabled to the save statement? HTH Bob "Helmut" wrote in message ... I have the following code within an "xltm" file which I want to then save as "xlsm": Do fName = Application.GetSaveAsFilename(InitialFileName:="ku pa", filefilter:= _ " Excel Macro Enabled Workbook (*.xlsm), *.xlsm,") Loop Until fName < False ActiveWorkbook.SaveAs Filename:=fName I get ERROR on last statement. How can I add "FileFormatValue = 52" to save the file as a "MacroEnabled" thanks . |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
xltm saveas xlsm
Bob,
I get "Run-time error '1004' - Method 'SaveAs' of 'object '_Workbook' failed." Helmut "Bob Phillips" wrote: Did you try adding FileFormat:= xlOpenXMLWorkbookMacroEnabled to the save statement? HTH Bob "Helmut" wrote in message ... I have the following code within an "xltm" file which I want to then save as "xlsm": Do fName = Application.GetSaveAsFilename(InitialFileName:="ku pa", filefilter:= _ " Excel Macro Enabled Workbook (*.xlsm), *.xlsm,") Loop Until fName < False ActiveWorkbook.SaveAs Filename:=fName I get ERROR on last statement. How can I add "FileFormatValue = 52" to save the file as a "MacroEnabled" thanks . |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
xltm saveas xlsm
This is odd Helmut. I have just tried your code and it works fine for me, I
didn't even need the FileFormat property, so there must be something else in your code. HTH Bob "Helmut" wrote in message ... Bob, I get "Run-time error '1004' - Method 'SaveAs' of 'object '_Workbook' failed." Helmut "Bob Phillips" wrote: Did you try adding FileFormat:= xlOpenXMLWorkbookMacroEnabled to the save statement? HTH Bob "Helmut" wrote in message ... I have the following code within an "xltm" file which I want to then save as "xlsm": Do fName = Application.GetSaveAsFilename(InitialFileName:="ku pa", filefilter:= _ " Excel Macro Enabled Workbook (*.xlsm), *.xlsm,") Loop Until fName < False ActiveWorkbook.SaveAs Filename:=fName I get ERROR on last statement. How can I add "FileFormatValue = 52" to save the file as a "MacroEnabled" thanks . |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
xltm saveas xlsm
Bob,
The following did finally work: ' Save File as "xlsm" in new location Do fName = Application.GetSaveAsFilename(InitialFileName:=Myv alue, filefilter:= _ " Excel Macro Enabled Workbook (*.xlsm), *.xlsm,") Loop Until fName < False ActiveWorkbook.SaveAs Filename:=fName, FileFormat:=xlOpenXMLWorkbookMacroEnabled Thanks for your help anyhow. "Bob Phillips" wrote: This is odd Helmut. I have just tried your code and it works fine for me, I didn't even need the FileFormat property, so there must be something else in your code. HTH Bob "Helmut" wrote in message ... Bob, I get "Run-time error '1004' - Method 'SaveAs' of 'object '_Workbook' failed." Helmut "Bob Phillips" wrote: Did you try adding FileFormat:= xlOpenXMLWorkbookMacroEnabled to the save statement? HTH Bob "Helmut" wrote in message ... I have the following code within an "xltm" file which I want to then save as "xlsm": Do fName = Application.GetSaveAsFilename(InitialFileName:="ku pa", filefilter:= _ " Excel Macro Enabled Workbook (*.xlsm), *.xlsm,") Loop Until fName < False ActiveWorkbook.SaveAs Filename:=fName I get ERROR on last statement. How can I add "FileFormatValue = 52" to save the file as a "MacroEnabled" thanks . . |
#7
Posted to microsoft.public.excel.programming
|
|||
|
|||
xltm saveas xlsm
I suggested that and you said you had tried it!
-- HTH Bob "Helmut" wrote in message ... Bob, The following did finally work: ' Save File as "xlsm" in new location Do fName = Application.GetSaveAsFilename(InitialFileName:=Myv alue, filefilter:= _ " Excel Macro Enabled Workbook (*.xlsm), *.xlsm,") Loop Until fName < False ActiveWorkbook.SaveAs Filename:=fName, FileFormat:=xlOpenXMLWorkbookMacroEnabled Thanks for your help anyhow. "Bob Phillips" wrote: This is odd Helmut. I have just tried your code and it works fine for me, I didn't even need the FileFormat property, so there must be something else in your code. HTH Bob "Helmut" wrote in message ... Bob, I get "Run-time error '1004' - Method 'SaveAs' of 'object '_Workbook' failed." Helmut "Bob Phillips" wrote: Did you try adding FileFormat:= xlOpenXMLWorkbookMacroEnabled to the save statement? HTH Bob "Helmut" wrote in message ... I have the following code within an "xltm" file which I want to then save as "xlsm": Do fName = Application.GetSaveAsFilename(InitialFileName:="ku pa", filefilter:= _ " Excel Macro Enabled Workbook (*.xlsm), *.xlsm,") Loop Until fName < False ActiveWorkbook.SaveAs Filename:=fName I get ERROR on last statement. How can I add "FileFormatValue = 52" to save the file as a "MacroEnabled" thanks . . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How to make a .XLTM template file default to save as .XLSM type? | Excel Discussion (Misc queries) | |||
xlsm SaveAs xls | Excel Programming | |||
SaveAs - - provide option to Save As .xlsm or .xls | Excel Programming | |||
SaveAs XLSM question | Excel Programming | |||
SaveAs xltm programmatically | Excel Programming |