ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Saving a document in a particular file (https://www.excelbanter.com/excel-discussion-misc-queries/250546-saving-document-particular-file.html)

Wombat

Saving a document in a particular file
 
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.

Gord Dibben

Saving a document in a particular file
 
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

On Wed, 9 Dec 2009 05:06:01 -0800, Wombat
wrote:

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.




All times are GMT +1. The time now is 12:47 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com