Creating two linked copies of one workbook

J

Jim

Hello. I would like to create two spreadsheets that are exactly the same in
two different places. Essentially, I would like to use a spreadsheet on my
local drive that updates a spreadsheet on a network drive that is accessible
to other people. This way when I save to my local spreadsheet it
automatically updates to the network document. Can this be done and how?
Thanks.
 
R

Ron de Bruin

Hi Jim

Try this

You can use SaveCopyAs
Copy this in the Thisworkbook module to save the file also in C:\ (change that)

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
ThisWorkbook.SaveCopyAs "C:\" & ThisWorkbook.Name
End Sub
 
J

Jim

Ron,

Thanks for the prompt response! I have never used the savecopyas feature.
If you could give me a bit more detail on exactly how to use this that would
be great.

Thanks
 
R

Ron de Bruin

Hi Jim

Right click on the Excel icon next to File in the Worksheet menu bar
Choose view code
Paste this event in the Thisworkbook module that is now active
Alt-q to go back to Excel

Change the path (C:\) to your network path
like this \\????\????\

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
ThisWorkbook.SaveCopyAs "C:\" & ThisWorkbook.Name
End Sub

Now everytime you save your local workbook it will save a copy on the network
 
Top