Application.Dialogs(xlDialogSaveAs).Show to have the name (some predetermined text) all ready input

sdoppke

Well-known Member
Joined
Jun 10, 2010
Messages
647
Hi everyone i use the below code to bring up a userform that allows the save as feature to pop up. Id like to modify it so the file name that it saves as is some other text and NOT the original file name. Thanks for any help. :)

Code:
Private Sub CommandButton1_Click()
Application.Dialogs(xlDialogSaveAs).Show
SaveWFMTool.Hide
End Sub

sd
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
You could instead use Application.GetSaveAsFilename and then test. Or make the workbook read-only.
 
Upvote 0
You could instead use Application.GetSaveAsFilename and then test. Or make the workbook read-only.


i have toyiong with that for a while now and cant figure it out :( feelin dumb.

I may have stated it poorly. I want to have the save as feature pop up, so the user can chooser where they want to save, but would like the name of the file to be there already. (it will not be the default file name) it will based on variable from cells.

Hope that help and thanks for hte reply.

sd
 
Upvote 0
Maybe like this:

Code:
    Dim sFile As String
 
    sFile = Application.GetSaveAsFilename(InitialFileName:="Bob.xls")
    If sFile = "False" Then Exit Sub
 
    If sFile = ThisWorkbook.FullName Then
        MsgBox "Bad boy!"
        Exit Sub
    Else
        ThisWorkbook.SaveAs sFile
    End If
 
Upvote 0

Forum statistics

Threads
1,224,595
Messages
6,179,798
Members
452,943
Latest member
Newbie4296

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