adelcarpio
New Member
- Joined
- Apr 3, 2013
- Messages
- 4
I am getting an error when the scheduled autosave feature that also updates links in my workbook finds the source workbooks open. It runs with no problem when the source WBs are closed.
So, I tried to use Workbooks("source WB1.xls").close but it doesn't seem to work. These source workbooks can be open or closed on the same computer and drive where this code is running. Will including .close give me an error if the source workbook is already closed? I am very new with VBA, could anybody give me tips to work with this kind of function and linked workbooks.
Code:
Sub SaveBook()
With ThisWorkbook
.Sheets("Receiving").Select
.UpdateLink Name:="C:\Users\Public\Documents\source WB1.xls"
.UpdateLink Name:="C:\Users\Public\Documents\source WB2.xls"
.Save
End With
Call StartTimer
End Sub
So, I tried to use Workbooks("source WB1.xls").close but it doesn't seem to work. These source workbooks can be open or closed on the same computer and drive where this code is running. Will including .close give me an error if the source workbook is already closed? I am very new with VBA, could anybody give me tips to work with this kind of function and linked workbooks.