VBA Script needed to Change default 'SAVE' location but NOT save file automatically

hallred

New Member
Joined
Jun 22, 2016
Messages
2
I have a file that is distributed to many users. I need to embed a VBA script in the file that when run opens the 'Save As' dialogue box to a specific folder location BUT does not save the file.

The users will need to select a sub-folder within the primary folder and enter the file name in order to complete the save function. I see many codes to save the file automatically but I need the users to actually complete this process manually.

Please help.
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
yky,

Thanks for the link. I didn't find that when I did my original search. I've got this code working exactly as I need it except the file location does not default to where the users need to be. I need the save as location to start in "//corporate/certificates"

Code:
Sub FileSave()
Dim IntialName As String
Dim fileSaveName As Variant
InitialName = Range("K5")
fileSaveName = Application.GetSaveAsFilename(InitialFileName:=InitialName, _
    Filefilter:="Excel Files (*.xlsm), *.xls")


If fileSaveName <> False Then
    MsgBox "Save as " & fileSaveName
End If
End Sub
 
Upvote 0
Try this:

Code:
Sub FileSave()
Dim IntialName As String
Dim fileSaveName As Variant
[COLOR=#0000cd]Const Path_Prefix="//corporate/certificates/"[/COLOR]
InitialName = Range("K5")
fileSaveName = Application.GetSaveAsFilename(InitialFileName:=InitialName, _
    Filefilter:="Excel Files (*.xlsm), *.xls")

If fileSaveName <> False Then
   [COLOR=#0000cd] fileSaveName= Path_Prefix & fileSaveName[/COLOR]
    MsgBox "Save as " & fileSaveName
End If
End Sub
 
Upvote 0

Forum statistics

Threads
1,221,310
Messages
6,159,176
Members
451,543
Latest member
cesymcox

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