techmanbd
Well-known member
Ok, what is happening is that on the computer I am writing the code on, when I run it it works fine. The excel file opens.
BUT when I put it on another computer I get the error donw at the bottom.
Here is my code
BUT when I put it on another computer I get the error donw at the bottom.
Here is my code
Code:
Dim strExFile As String = strPath & "\filename.xls"
Try
exSheet = exApp.Workbooks.Open(strExFile).Worksheets(strWS)
Catch ex As Exception
MessageBox.Show("Couldnt open or find -" & strExFile & ". Error message = " & Err.Description & _
". Error number = " & Err.Number)
exApp.Quit()
exSheet = Nothing
exApp = Nothing
GC.Collect()
Exit Sub
End Try
[CODE]
And I get this error
"Couldnt open or find -C:\Program Files\companyname\file\filename.xls. Error message = Object refernce not set to an instance of an object. Error Number = 91 "