Force Path for File Saving

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

is there a way in Excel to force the file name and path - thus preventing
the user from choosing his own under the file, save as drop down.

I want to do this to prevent users on a shared workbook saving versions of
the file...I want it to always save to the same file on the network thus
preventing multiple copies.

Thanks for your help....Chris
 
Chris

You could put some Workbook_BeforeSave() event code in the ThisWorkbook
module in your workbook. (To implement right click on the Excel icon at the
top left of the workbook and select view code... Paste here)

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)
If SaveAsUI Then Cancel = True
MsgBox "You cannot save this file to another location", _
vbOKOnly + vbInformation, "Error"
End Sub

If a user selects Save as... it will cancel the save and alert the user.
This way they can only save to the original workbook. (They can take a copy
of course)

--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
(e-mail address removed)
www.nickhodge.co.uk
 

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

Back
Top