I am getting a run-time error '424' object required when I run the following code:
the line workbooks.open is where I am getting the error
Any help would gratefully appreciated!
Private Sub cmd_mn01_c1_Click()
Dim excelfile As String
excelfile = dir("\\FS125OMD02.dsnyad.nycnet\omd_data$\OMD Library\Snow Route Sectoring\Snow Sectoring FY17\Manhattan FY17\MN01\MN01 Critical Routes\MN01 Critical 01 Rev *.xlsx")
If excelfile <> "" Then
workbooks.Open FileName:=excelfile
Else
MsgBox "Can't Find File: O:\OMD Library\Snow Route Sectoring\Snow Sectoring FY17\Manhattan FY17\MN01\MN01 Critical Routes\MN01 Critical 01 Rev *.xlsx"
End If
End Sub
the line workbooks.open is where I am getting the error
Any help would gratefully appreciated!
Private Sub cmd_mn01_c1_Click()
Dim excelfile As String
excelfile = dir("\\FS125OMD02.dsnyad.nycnet\omd_data$\OMD Library\Snow Route Sectoring\Snow Sectoring FY17\Manhattan FY17\MN01\MN01 Critical Routes\MN01 Critical 01 Rev *.xlsx")
If excelfile <> "" Then
workbooks.Open FileName:=excelfile
Else
MsgBox "Can't Find File: O:\OMD Library\Snow Route Sectoring\Snow Sectoring FY17\Manhattan FY17\MN01\MN01 Critical Routes\MN01 Critical 01 Rev *.xlsx"
End If
End Sub