D
DDawson
I have a workbook open event that opens and vlooksup other Wbooks on my
office network.
My manager wants to use this, but the problem is, my code refers to the
linked books at the location: I:\example\path\workbooks\ and my managers PC
is set up so that the path should be T:\example\path\workbooks\.
Is there a simple way round this?
I enclose the code, below for further information.
Kind Regards
Dylan
Private Sub Workbook_Open()
Dim wbk1 As Workbook
Dim wbk2 As Workbook
Set wbk1 = Nothing
Set wbk2 = Nothing
On Error Resume Next
Set wbk1 = Workbooks("Export_Requests.csv")
Set wbk2 = Workbooks("Project Summary.xls")
On Error GoTo 0
If wbk1 Is Nothing Then
On Error GoTo 0
Set wbk1 = Workbooks.Open _
("I:\A&T Contracts\000 Utilities\Export_Requests.csv")
On Error GoTo 0
If wbk1 Is Nothing Then
MsgBox "Export_Requests.csv didn't open!"
Exit Sub
End If
wbk1.Windows(1).Visible = True
End If
If wbk2 Is Nothing Then
On Error Resume Next
Set wbk2 = Workbooks.Open _
("I:\A&T Contracts\000 Utilities\Project Specific\Contract
Docs\Integrated Utility Services\Option E\Payment\Project Summary.xls")
On Error GoTo 0
If wbk2 Is Nothing Then
MsgBox "Project Summary.xls didn't open!"
Exit Sub
End If
wbk2.Windows(1).Visible = True
End If
End Sub
office network.
My manager wants to use this, but the problem is, my code refers to the
linked books at the location: I:\example\path\workbooks\ and my managers PC
is set up so that the path should be T:\example\path\workbooks\.
Is there a simple way round this?
I enclose the code, below for further information.
Kind Regards
Dylan
Private Sub Workbook_Open()
Dim wbk1 As Workbook
Dim wbk2 As Workbook
Set wbk1 = Nothing
Set wbk2 = Nothing
On Error Resume Next
Set wbk1 = Workbooks("Export_Requests.csv")
Set wbk2 = Workbooks("Project Summary.xls")
On Error GoTo 0
If wbk1 Is Nothing Then
On Error GoTo 0
Set wbk1 = Workbooks.Open _
("I:\A&T Contracts\000 Utilities\Export_Requests.csv")
On Error GoTo 0
If wbk1 Is Nothing Then
MsgBox "Export_Requests.csv didn't open!"
Exit Sub
End If
wbk1.Windows(1).Visible = True
End If
If wbk2 Is Nothing Then
On Error Resume Next
Set wbk2 = Workbooks.Open _
("I:\A&T Contracts\000 Utilities\Project Specific\Contract
Docs\Integrated Utility Services\Option E\Payment\Project Summary.xls")
On Error GoTo 0
If wbk2 Is Nothing Then
MsgBox "Project Summary.xls didn't open!"
Exit Sub
End If
wbk2.Windows(1).Visible = True
End If
End Sub