ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   SaveAs Filename and FileFormat in Vs2007 (https://www.excelbanter.com/excel-discussion-misc-queries/150081-saveas-filename-fileformat-vs2007.html)

RobN[_2_]

SaveAs Filename and FileFormat in Vs2007
 
Using Excel 2007 (GRR!!), what do I change the FileFormat:=xlNormal (in the
code below) to to save as xlsm format?
The closest I could glean from Help was.....xlOpenXMLWorkbookMacroEnabled
But that doesn't seem to do it.

ActiveWorkbook.SaveAs Filename:= _
"C:\Documents and Settings\User\My Documents\Lou's Accounts\" &
Worksheets("Invoice").Range("I1").Text, _ FileFormat:=xlNormal,
_
Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False

Rob



Roger Govier

SaveAs Filename and FileFormat in Vs2007
 
Hi Rob

The following macro worked fine for me.

Sub SaveMacEnabled()

Application.DisplayAlerts = False
ActiveWorkbook.SaveAs Filename:="C:\Excel\Book3.xlsm", FileFormat:=
_
xlOpenXMLWorkbookMacroEnabled, CreateBackup:=False
Application.DisplayAlerts = False

End Sub
--
Regards

Roger Govier


"RobN" wrote in message
...
Using Excel 2007 (GRR!!), what do I change the FileFormat:=xlNormal
(in the code below) to to save as xlsm format?
The closest I could glean from Help
was.....xlOpenXMLWorkbookMacroEnabled
But that doesn't seem to do it.

ActiveWorkbook.SaveAs Filename:= _
"C:\Documents and Settings\User\My Documents\Lou's Accounts\" &
Worksheets("Invoice").Range("I1").Text, _
FileFormat:=xlNormal, _
Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False

Rob




Ron de Bruin

SaveAs Filename and FileFormat in Vs2007
 
Hi RobN

More info about the formats you can find on this page
http://www.rondebruin.nl/saveas.htm


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"RobN" wrote in message ...
Using Excel 2007 (GRR!!), what do I change the FileFormat:=xlNormal (in the
code below) to to save as xlsm format?
The closest I could glean from Help was.....xlOpenXMLWorkbookMacroEnabled
But that doesn't seem to do it.

ActiveWorkbook.SaveAs Filename:= _
"C:\Documents and Settings\User\My Documents\Lou's Accounts\" &
Worksheets("Invoice").Range("I1").Text, _ FileFormat:=xlNormal,
_
Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False

Rob



RobN[_2_]

SaveAs Filename and FileFormat in Vs2007
 
Good on ya Ron....Great info, thanks!

Rob

"Ron de Bruin" wrote in message
...
Hi RobN

More info about the formats you can find on this page
http://www.rondebruin.nl/saveas.htm


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"RobN" wrote in message
...
Using Excel 2007 (GRR!!), what do I change the FileFormat:=xlNormal (in
the code below) to to save as xlsm format?
The closest I could glean from Help was.....xlOpenXMLWorkbookMacroEnabled
But that doesn't seem to do it.

ActiveWorkbook.SaveAs Filename:= _
"C:\Documents and Settings\User\My Documents\Lou's Accounts\" &
Worksheets("Invoice").Range("I1").Text, _
FileFormat:=xlNormal, _
Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False

Rob




RobN[_2_]

SaveAs Filename and FileFormat in Vs2007
 
Thanks Roger,

I have it working now by putting the xlsm extension into the filename as I
noticed you had done.
It seems version2007 is not as intelligent as the previous version which
automatically did that for me!

(Yet another complaint about this clumsy version of the XL program.)

Rob

"Roger Govier" wrote in message
...
Hi Rob

The following macro worked fine for me.

Sub SaveMacEnabled()

Application.DisplayAlerts = False
ActiveWorkbook.SaveAs Filename:="C:\Excel\Book3.xlsm", FileFormat:= _
xlOpenXMLWorkbookMacroEnabled, CreateBackup:=False
Application.DisplayAlerts = False

End Sub
--
Regards

Roger Govier


"RobN" wrote in message
...
Using Excel 2007 (GRR!!), what do I change the FileFormat:=xlNormal (in
the code below) to to save as xlsm format?
The closest I could glean from Help was.....xlOpenXMLWorkbookMacroEnabled
But that doesn't seem to do it.

ActiveWorkbook.SaveAs Filename:= _
"C:\Documents and Settings\User\My Documents\Lou's Accounts\" &
Worksheets("Invoice").Range("I1").Text, _ FileFormat:=xlNormal, _
Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False

Rob







All times are GMT +1. The time now is 04:26 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com