EXCEL Problem

techmanbd

Well-known member
Joined
Sep 10, 2003
Messages
398
Location
Burbank, CA
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


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 "
 
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?
 
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.
 
Back
Top