Hi,
I have one worksheet with links to 4 different external files (.xlsm) protected by a password, located on a server.
So I have 4 macros opening each file (run by a macro) and the links can update. But I don't understand why only the last range is update and all the others have the #REF error.
Can I have some help on that?
Thanks
Sub file1()
'On Error GoTo here
Application.ScreenUpdating = False
Set ctc = Workbooks.Open(Filename:="file:///\\Server\Public\Documents\Folder\2017\File1\File1Name.xlsm", ReadOnly:=True, Password:="password")
ctc.Close False
here:
Application.ScreenUpdating = True
End Sub
Sub file2()
'On Error GoTo here
Application.ScreenUpdating = False
Set ctc = Workbooks.Open(Filename:="file:///\\Server\Public\Documents\Folder\2017\File2\File2Name.xlsm", ReadOnly:=True, Password:="password")
ctc.Close False
here:
Application.ScreenUpdating = True
End Sub
Sub file3()
'On Error GoTo here
Application.ScreenUpdating = False
Set ctc = Workbooks.Open(Filename:="file:///\\Server\Public\Documents\Folder\2017\File3\File3Name.xlsm", ReadOnly:=True, Password:="password")
ctc.Close False
here:
Application.ScreenUpdating = True
End Sub
Sub file4()
'On Error GoTo here
Application.ScreenUpdating = False
Set ctc = Workbooks.Open(Filename:="file:///\\Server\Public\Documents\Folder\2017\File4\File4Name.xlsm", ReadOnly:=True, Password:="password")
ctc.Close False
here:
Application.ScreenUpdating = True
End Sub
Sub update_all()
file1
file2
file2
file4
End Sub
I have one worksheet with links to 4 different external files (.xlsm) protected by a password, located on a server.
So I have 4 macros opening each file (run by a macro) and the links can update. But I don't understand why only the last range is update and all the others have the #REF error.
Can I have some help on that?
Thanks
Sub file1()
'On Error GoTo here
Application.ScreenUpdating = False
Set ctc = Workbooks.Open(Filename:="file:///\\Server\Public\Documents\Folder\2017\File1\File1Name.xlsm", ReadOnly:=True, Password:="password")
ctc.Close False
here:
Application.ScreenUpdating = True
End Sub
Sub file2()
'On Error GoTo here
Application.ScreenUpdating = False
Set ctc = Workbooks.Open(Filename:="file:///\\Server\Public\Documents\Folder\2017\File2\File2Name.xlsm", ReadOnly:=True, Password:="password")
ctc.Close False
here:
Application.ScreenUpdating = True
End Sub
Sub file3()
'On Error GoTo here
Application.ScreenUpdating = False
Set ctc = Workbooks.Open(Filename:="file:///\\Server\Public\Documents\Folder\2017\File3\File3Name.xlsm", ReadOnly:=True, Password:="password")
ctc.Close False
here:
Application.ScreenUpdating = True
End Sub
Sub file4()
'On Error GoTo here
Application.ScreenUpdating = False
Set ctc = Workbooks.Open(Filename:="file:///\\Server\Public\Documents\Folder\2017\File4\File4Name.xlsm", ReadOnly:=True, Password:="password")
ctc.Close False
here:
Application.ScreenUpdating = True
End Sub
Sub update_all()
file1
file2
file2
file4
End Sub