Save As - Cancel

michaelp1029

Board Regular
Joined
Jul 15, 2008
Messages
63
I've been looking online but have found no solutions. I have a maco created so that I can bring up a Save As dialog box. From this point on I would like a message box to state one thing if I press "Save As" and another message if I press the "cancel" button but have found no helpful data just yet. Help?
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
Something like this?

Code:
Sub test()
Dim fName As Variant
fName = Application.GetSaveAsFilename _
        (InitialFileName:="", _
        FileFilter:="Excel Files (*.XLS), *.XLS", _
                     Title:="Save As")
If fName = False Then
    MsgBox "User pressed cancel"
    Exit Sub
Else
    MsgBox "Saving as " & fName, vbInformation
    ActiveWorkbook.SaveAs Filename:=fName
End If
End Sub
 
Upvote 0

Forum statistics

Threads
1,203,629
Messages
6,056,417
Members
444,862
Latest member
more_resource23

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