Help with a save as macro command


Posted by Jamey Schaetzel on July 03, 2001 6:31 AM

I am having trouble with a save as in a macro that I created. This macro grabs data from numerous areas in a couple of worksheets, and then populates many different reports, according to some conditions within the macro. After this is done, I want to be able to print to Adobe Distiller and create pdf files. Everytime that a new report is created, I am prompted to save the file as a new name. What I want to be able to do is to somehow include the save as code into the macro. Basically, I want all of this to be automated.

I think that it may be something with a loop of some sort, but have look a lot of different places, and haven't been able to make anything work. Anything would be helpful to me, and my work. Thank you very much in advance.

Jamey Schaetzel



Posted by G-Man on July 03, 2001 6:21 PM

Jamie,

You might try something like this, assuming you are saving it in Excel:

Sub SaveAsMyFile()
Application.DisplayAlerts = False
ActiveWorkbook.SaveAs FileName:="C:\MyFile.xls", _
FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False
End Sub

G-Man