LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Trouble Programming from DotNet Against Multiple Excel Versions

My application works with Excel to put together spreadsheets for
reporting purposes. It runs just fine on my box, but when I put it on
another one, it bombs.

Here is the relevant code:

Public Function ImportSis(ByVal strSisFile As String) As Boolean
If m_Excel Is Nothing Then
m_Excel = New Excel.Application
End If
m_Excel.Visible = True
Dim oSis As Excel.Workbook
oSis = m_Excel.Workbooks.Open(strSisFile)

At that point, I get a NullReferenceException, saying that oSis hasn't
been instantiated. This method, though, returns a new reference so
instantiation should be irrelevant. For grins, I did a NEW right before
on the oSis, but got the same error.

This code runs just fine on my development box, running Excel 2003. It
also runs on another box that has Excel 2002. It bombs when on a box
running Excel 2000. I originally had used the reference for "Microsoft
Excel 11.0 Object Library" but when I suspected I had a versioning
problem I removed that reference, grabbed an "Excel09.olb" file off of
someone else's box running Office 2000, and made a reference to THAT
instead. That didn't solve my problem, though, and I just now took
another look at it and it somehow got back to the 11.0 version; weird.

Long story; anyone have any suggestions? How can I correctly reference
an Excel 2000 library instead, and do I need to worry about detecting the
version of Excel to load maybe a different version of the library at
runtime?

I appreciate any help.

--
Michael

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to you open multiple versions of Excel buriedinit Excel Discussion (Misc queries) 1 June 21st 06 06:19 AM
Multiple Excel versions. Naveen Mukkelli Excel Discussion (Misc queries) 0 May 16th 06 12:55 AM
VB6 COM Add-In for multiple Excel and Word versions Yossi[_2_] Excel Programming 1 November 6th 04 08:11 PM
VB6 COM Add-In for multiple Excel and Word versions Yossi[_2_] Excel Programming 0 November 3rd 04 08:09 PM
updating Excel from DotNet Lisa[_11_] Excel Programming 0 August 19th 04 06:17 PM


All times are GMT +1. The time now is 08:37 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"