Johnny C
Well-known Member
- Joined
- Nov 7, 2006
- Messages
- 1,069
- Office Version
- 365
- Platform
- Windows
I've got 2 files, one with a sheet linked to the other so that they are the same sheet.
The sheet linking to the other one is "Forecast - 8 - Output - 2020-23.xlsb"
On sheet Constants, the formula in cell M22 is
='[Forecast - 1 - Assumptions - 2020-23.xlsb]Constants'!M22
That file is open. The value is the same, 50.277
Both files are saved.
Last year, that cell had 48.184 in. it got updated 2 months ago. It's just a hard-typed number.
I have some VBA to update a load of linked files, 2 of which are the above. They need to be opened in a certain order, and neither must update any other links other than those between the 2 files.
Before this runs, both files have 50.277 in.
strLinkedFile = "Forecast - 8 - Output - 2020-23.xlsb"
strLinkedFileName = "Forecast - 1 - Assumptions - 2020-23.xlsb"
When this runs, and I open the file "Forecast - 8 - Output - 2020-23.xlsb" (and links not updated) the value in cell M22 has reverted to 48.184 - the value that was in last year. if I double click to open the source, it updates to 50.277
WTF is going on?
The sheet linking to the other one is "Forecast - 8 - Output - 2020-23.xlsb"
On sheet Constants, the formula in cell M22 is
='[Forecast - 1 - Assumptions - 2020-23.xlsb]Constants'!M22
That file is open. The value is the same, 50.277
Both files are saved.
Last year, that cell had 48.184 in. it got updated 2 months ago. It's just a hard-typed number.
I have some VBA to update a load of linked files, 2 of which are the above. They need to be opened in a certain order, and neither must update any other links other than those between the 2 files.
Before this runs, both files have 50.277 in.
strLinkedFile = "Forecast - 8 - Output - 2020-23.xlsb"
strLinkedFileName = "Forecast - 1 - Assumptions - 2020-23.xlsb"
Code:
' Open file with links but don't update links
Workbooks.Open strFolder & strFile, UpdateLinks:=False
...
Workbooks.Open strLinkedFile, UpdateLinks:=False
Workbooks(strLinkedFileName).Close (False) ' Don't save changes in Linked file
Workbooks(strFile).Close (True) ' Save changes
When this runs, and I open the file "Forecast - 8 - Output - 2020-23.xlsb" (and links not updated) the value in cell M22 has reverted to 48.184 - the value that was in last year. if I double click to open the source, it updates to 50.277
WTF is going on?