Hi! I'm working on a problem, which included two files: a master excel file and a slave read-only excel file. Both are with macro's.
The first file is the so-called master file. This file is open and is available for reading and writing.
The second file is the so-called slave file. This file is open and is read-only. The file is essentally a copy of the master file. Its cells contains references to the master file - like: ='[test-from.xlsm]Sheet1'!A2.
Both are on a server and the files are normally not opened on the same computer.
What a macro needs to do at the master file, is to save every 30 seconds, since it has been opened. I've tried doing that using this code:
Private Sub Auto_Open()
'call all subs to start automatically
Call StartTimer
End Sub
===
Sub Save_Timer()
'TODO make if-statement to only save when workbook has changed
ActiveWorkbook.Save
'save ActiveWorkbook
Application.OnTime Now() + TimeValue("00:00:30"), "Save_Timer"
'starts timer to run for 30 seconds and starts Save_Timer
End Sub
What a second module needs to do at the slave file, is to update every reference (in essence recalculating?) and save afterwards every 15 seconds.
The code I've made so far:
Private Sub Auto_Open()
'call all subs to start automatically
Call Update_Links
End Sub
Sub Update_Links()
'TODO make if-statement to only save when workbook has changed
Application.CalculateFull
'update all links
ActiveWorkbook.Save
'save ActiveWorkbook
Application.OnTime Now() + TimeValue("00:00:15"), "Save_Timer"
'starts timer to run for 15 seconds and starts Save_Timer
End Sub
How simple this might seem, it does not work. Anyone in to help a lost Excel user?
Bookmarks