Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Push updates to other workbooks?
I have a master workbook and 5 different workbooks that have links to the
master workbook. I have to password protect my master workbook as it has salaries and not everyone should be allowed to see those. I would like to make an update to the master workbook and have the update be "pushed down" into the other workbooks, can this be done? I don't want users to open the other workbooks and select update because they then need to know the password to the master workbook, which would mute the point of having the master workbook being password protected. Thanks!!! |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Push updates to other workbooks?
A simple macro like this should work. The macro would reside in the master
and would be run after you've updated the master. The links should update automatically. Sub UpdateLinks() 'Update First Workbook Workbooks.Open Filename:="C:\Sub1.xls" ActiveWorkbook.Save ActiveWindow.Close 'Update Last Workbook Workbooks.Open Filename:="C:\Sub2.xls" ActiveWorkbook.Save ActiveWindow.Close End Sub |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Push updates to other workbooks?
You could write a "update file" with a macro (VBA) that includes the passord
and path to your master file from which their individual 5 files can copy the data and paste into their workbooks where the data belongs. This way you could have your master file centrally located for you to modify and they can re-use the "update file" to get the updates. "ChrisP" wrote: I have a master workbook and 5 different workbooks that have links to the master workbook. I have to password protect my master workbook as it has salaries and not everyone should be allowed to see those. I would like to make an update to the master workbook and have the update be "pushed down" into the other workbooks, can this be done? I don't want users to open the other workbooks and select update because they then need to know the password to the master workbook, which would mute the point of having the master workbook being password protected. Thanks!!! |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Push updates to other workbooks?
This is wonderful!!! Thanks so much! One other question, how do I write it if
the other workbooks are password protected? Thanks again! "Mike H." wrote: A simple macro like this should work. The macro would reside in the master and would be run after you've updated the master. The links should update automatically. Sub UpdateLinks() 'Update First Workbook Workbooks.Open Filename:="C:\Sub1.xls" ActiveWorkbook.Save ActiveWindow.Close 'Update Last Workbook Workbooks.Open Filename:="C:\Sub2.xls" ActiveWorkbook.Save ActiveWindow.Close End Sub |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Push updates to other workbooks?
Assuming the passwords are "Frogs", the code is:
Workbooks.Open Filename:="c:\Sub1.xls", Password:="Frogs", UpdateLinks:=3, WriteResPassword:="Frogs" |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Push updates to other workbooks?
Great!!! Now my last question, how would I get this code to run when the user
closes the workbook? Thanks again for all the wonderful answers!!! "Mike H." wrote: Assuming the passwords are "Frogs", the code is: Workbooks.Open Filename:="c:\Sub1.xls", Password:="Frogs", UpdateLinks:=3, WriteResPassword:="Frogs" |
#7
Posted to microsoft.public.excel.programming
|
|||
|
|||
Push updates to other workbooks?
Go into the VBA editor and on the tree on the left, click the ThisWorkbook
under the Microsoft Excel Objects and then over to the right select the "Workbook" pulldown and then select the "BeforeClose" pulldown to the right of that. There will now be a sub created: Private Sub Workbook_BeforeClose(Cancel as Boolean). Place the code there inside the Sub. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Best practice for managing updates w/in distrubted workbooks? | Excel Discussion (Misc queries) | |||
Push updates from one workbook to others? | Excel Worksheet Functions | |||
Grouping workbooks to make updates | Excel Discussion (Misc queries) | |||
Push the button | Excel Programming | |||
Which button did I push | Excel Programming |