Saving in a different version.....

Jorn

Board Regular
Joined
Jul 10, 2003
Messages
92
Good Afternoon,

I have the following code that initiates a save dialogue box and saves the file that is currently open on the screen.

Private Sub SaveasButton_Click()
Do
fName = Application.GetSaveAsFilename
Loop Until fName <> False
ActiveWorkbook.SaveAs FileName:=fName
End Sub

The problem i have is that it will only save as the current file type of the open excel document (which in this case is excel 1). I need this to save as excel5.

Does anyone have any ideas?

John.
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
hi!

try this!


<font face=Courier New><SPAN style="color:#00007F">Sub</SPAN> Macro1()
fname = "C:\test\IMexcel5.xls"
    ActiveWorkbook.SaveAs Filename:= _
        fname, FileFormat:= _
        xlExcel5, Password:="", WriteResPassword:="", ReadOnlyRecommended:=False _
        , CreateBackup:=False
<SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">Sub</SPAN>
</FONT>
 
Upvote 0
Howdy,

I need the save dialog box to open like any other windows program with the ability to switch the current directory at whim to wherever.

John.
 
Upvote 0
hi!
Private Sub SaveasButton_Click()
Do
fName = Application.GetSaveAsFilename
Loop Until fName <> False
ActiveWorkbook.SaveAs Filename:= _
fname, FileFormat:= _
xlExcel5, Password:="", WriteResPassword:="", ReadOnlyRecommended:=False _
, CreateBackup:=False
End Sub
 
Upvote 0
Cheers matey!

This works a treat and I thank you for all your help. Hopefully telling them to save "just as in Excel" wont confuse the poor dears as much as explaining file versions!

Take Care and thanks again!!

John.
 
Upvote 0

Forum statistics

Threads
1,214,986
Messages
6,122,611
Members
449,090
Latest member
vivek chauhan

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top