Help with SaveAs path

BGrubb

New Member
Joined
Feb 25, 2008
Messages
19
I have an .xlsm file posted on Sharepoint to be accessed by a group of users some of which are not very proficient in Excel. I have a screen that opens when the file is opened that instructs them to save the file (form) on their PC before using it. Several have saved over it on the Sharepoint site or saved a copy on the sharepoint site since that is what comes up when they use "SaveAs". Is there something I can put in the code so it will come up to show their computer instead of the Sharepoint site to save it to. I tried ChDir to C:\ but that doesn't work because Sharepoint is on their C drive.

Any help would be appreciated.
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
One more thing. They can still cause a problem is they choose "Cancel" on this screen. Any ideas how I can prevent that?
 
Upvote 0
You can never make it 100% bulletproof.

This would annoy (and insult) me as an end user, but you asked for it so here it is...

Code:
Sub SaveAs_My_Docs()
    
    Dim Filename As String
    
    ChDrive "C"
    ChDir Environ$("USERPROFILE") & "\My Documents\"
    
    Do
        Filename = Application.GetSaveAsFilename( _
                   FileFilter:="xls Files (*.xls*), *.xls*")
        If Filename <> "False" Then
            ActiveWorkbook.SaveAs
        Else
            MsgBox "You must save a copy." & vbCr & "Yes, Bob. I'm looking at you.", vbCritical, "Save a Copy"
        End If
    Loop Until Filename <> "False"
    
End Sub
 
Upvote 0
Setting the file to open read-only would accomplish a similar goal (this is in options in the save as dialog). Though I also find some users get confused - they think the alert that says the file is read-only means it cannot be opened at all. It would prevent users from saving over the original and would require them to find a new name/directory for the file when saving - but that could still be anywhere. It's not foolproof since the file can be saved with a new name and then re-saved in place of the old file (one would have to *want* to do this though to get this far).
 
Upvote 0

Forum statistics

Threads
1,224,585
Messages
6,179,702
Members
452,938
Latest member
babeneker

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