Accessing Excel from VB.net

cjohnson

Well-known member
Joined
Sep 21, 2006
Messages
63
Location
WV
Programming Experience
1-3
Hi Everyone,

I am not sure which forum this belongs in, but I have a question about accessing Excel from VB.net. I have done this many times, but I just wrote a program for a coworker, that among other things, accesses Excel two different times. I work in Excel 2002 or 2003, and my coworker works in Excel 2000. When he runs the program, it can open a new Excel sheet and display data, but when the program tries to open an existing Excel sheet and pull data out, it errors out. I have tried this on my computer with the same Excel sheet, and it works fine. Is the problem the version of Interop.Excel.dll that I am providing him? I am including Microsoft Excel 10.0 Object library in the program. My only other option is Microsoft Excel 5.0. Any ideas?

Thanks very much,
Chris Johnson
 
For normal early binding you must both use same version. It is possible to do late binding for Office automation, it is also possible to access excel data with OleDB. Search our forums for "Excel" and you will find very much. Web is also very resourceful on this topic.
 
Hi Again,

I tried the late binding instead. Inspite of what I have heard before, it was very easy to early bind and then convert. Seems to work great.

Thanks very much,
Chris
 
Back
Top