Save As Version

  • Thread starter Thread starter ianripping
  • Start date Start date
I

ianripping

Hi.

I use a macro to create a workbook. At the end of the macro I tel
excel to bring up the save as dialog using:

myname = Application.Dialogs(xlDialogSaveAs).Show
If myname = False Then MsgBox "You cancelled the Save operation."
vbInformation, "Cancelled"

the problem that I have is that it asks what version I want to use.
need to use excel vs 97. How can I get this dialog to stop asking m
for a version so that it just knows to save it in xl97 format
 
Dim fName as String
fName = Application.GetSaveAsFileName()
if lcase(fName) <> "false" then
Application.DisplayAlerts = False
ActiveWorkbook.SaveAs Filename:=fName, _
FileFormat:=xlWorkbookNormal
Application.DisplayAlerts = True
Else
MsgBox "You cancelled the Save Operation", _
vbInformation, "Cancelled"
End if

Remove Application.DisplayAlerts = False if you want notification if you
are going to overwrite an existing file.
See Help on GetSaveAsFilename for additional arguments. GetSaveAsFileName
displays the file saveas dialog, but only returns the fully qualified
path/name of the selection, so you then control saving of the file as shown
above.
 

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

Back
Top