Saving a document in a particular file

W

Wombat

Is it possible to restrict the locations in which an Excel document can be
saved?

I want to put a restriction on a particular file so that the people I send
it to have to save it in a specific location on their hard drives...

Thanks for any help.
 
G

Gord Dibben

Copy/paste to Thisworkbook module.

Edit to suit your path.

Private Sub Workbook_BeforeSave(ByVal _
SaveAsUI As Boolean, Cancel As Boolean)
'Saves the current file to a certain folder
'Note that any previous version is overwritten
Application.DisplayAlerts = False
ActiveWorkbook.SaveAs Filename:="C:\Gordstuff\" & _
ActiveWorkbook.Name
Application.DisplayAlerts = True
End Sub


Gord Dibben MS Excel MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top