Excel Save As With Different File Type

JADownie

Active Member
Joined
Dec 11, 2007
Messages
395
Hi,

I currently have a macro in my file (XLSM) which has a step where the user saves out the workbook in the current format.

Sub SaveAS_Final()
Dim strName As String


SvName = Sheets("Instructions").Range("C51")

Application.Dialogs(xlDialogSaveAs).Show SvName


End Sub


But since my file is an XLSM file, when the Save As window pops up, it defaults to XLSM, but I actually want to save as an XLSX file. Is there anyway to tweak my current code to make that change in file type instead of the user having to manually change?

Thanks for any tips!
 
Last edited:

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
Just a little more digging found this... Try Application.Dialogs(xlDialogSaveAs).Show SvName, 51


51 = XLSX
52 = XLSM

CN.
 
Upvote 0
Hi,

Does anyone know what the code # is for XLM? Currently my files saves as XLS but I would like it to save as an XLM isntead....


Application.Dialogs(xlDialogSaveAs).Show SvName, 51
 
Upvote 0

Forum statistics

Threads
1,215,002
Messages
6,122,652
Members
449,092
Latest member
peppernaut

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