Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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 "

Live as if you were to die tomorrow. Learn as if you were to live forever.
Gandhi
Posted

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.

Live as if you were to die tomorrow. Learn as if you were to live forever.
Gandhi
Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...