techmanbd Posted November 20, 2003 Posted November 20, 2003 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 Dim strExFile As String = strPath & "\filename.xls" Try exSheet = exApp.Workbooks.Open(strExFile).Worksheets(strWS) Catch ex As Exception MessageBox.Show("Couldn't 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 "Couldn't 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 " Quote Live as if you were to die tomorrow. Learn as if you were to live forever. Gandhi
Administrators PlausiblyDamp Posted November 20, 2003 Administrators Posted November 20, 2003 Does the other computer have Excel installed on it? Also does the file exist in the correct place? If you go to start->run and type in the path does excel open the correct file? Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
techmanbd Posted November 21, 2003 Author Posted November 21, 2003 Yes, the machine has excel and I went and did the run and it comes up Quote Live as if you were to die tomorrow. Learn as if you were to live forever. Gandhi
techmanbd Posted November 21, 2003 Author Posted November 21, 2003 I think I may have found my problem, On my computer I have the excel library 10.0 and on the other computer the excel version is 9.0 So how can I get this to work? without having to downgrade my ms office or upgrading to office xp on the other computer? license reason why. Quote Live as if you were to die tomorrow. Learn as if you were to live forever. Gandhi
techmanbd Posted November 21, 2003 Author Posted November 21, 2003 Found my answer, here is a link for who ever has the same problem. http://beta.experts-exchange.com/Programming/Programming_Languages/Visual_Basic/Q_20697219.html Talks about automation which is another term for late binding. I used this and it worked great Quote Live as if you were to die tomorrow. Learn as if you were to live forever. Gandhi
Recommended Posts