Update Links

psamu

Active Member
Joined
Jan 3, 2007
Messages
462
I would appreciate your help, I have two workbook and one is linked to another one and read only. I just wanted to update automatically when I update the main one evenif some users open the linked workbook. (In the background without seeing linked workbook need to be updated immediately) Thanks.
 
Last edited:

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
Is there anyway if the other workbook already open by other users in readonly? Source workbook saving is fine.
 
Upvote 0
I would like to have some vba for when master file close then open the linked workbook (password protected) and update the link and save and close.
 
Upvote 0
Below code works fine, but if the file protected with the password then asking for the password. How do I add the password in below code. Thanks


Private Sub Workbook_BeforeClose(Cancel As Boolean)
If ThisWorkbook.ReadOnly Then
ThisWorkbook.Saved = True
End If
Workbooks.Open "F:\Accounting\TestSub.xls", UpdateLinks:=xlUpdateLinksAlways
ActiveWorkbook.Close SaveChanges:=True
End Sub
 
Upvote 0
The Open method has a Password argument:

Code:
Workbooks.Open "F:\Accounting\TestSub.xls", UpdateLinks:=xlUpdateLinksAlways, Password:="YourPassword"
 
Upvote 0
I put that code, but still asking for password.

Private Sub Workbook_BeforeClose(Cancel As Boolean)
If ThisWorkbook.ReadOnly Then
ThisWorkbook.Saved = True
End If
Workbooks.Open "Q:\Accounting\TestSub.xls", UpdateLinks:=xlUpdateLinksAlways,
Password:="Test"
ActiveWorkbook.Close SaveChanges:=True
End Sub
 
Upvote 0
Same password "Test" It is simply prompting fore the password. (Reserved by ....... Enter password for write access, or open read only. Password..............
 
Upvote 0

Forum statistics

Threads
1,224,587
Messages
6,179,738
Members
452,940
Latest member
Lawrenceiow

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top