SaveAs Filename and FileFormat in Vs2007

R

RobN

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
 
R

Roger Govier

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
 
R

RobN

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top