"Cindy M." <C.Meister-C@hispeed.ch> wrote in message
news:VA.00000850.00786be1@speedy...
> Hi Sebastian,
>
>> I am adding a function to my VB.NET application that allows reading data
>> from an Excel file. I have added a reference to "Microsoft Excel 11.0
>> Object
>> Library", since I have Office 2003 on my PC.
>>
>> This is working fine so far, but the application will also be installed
>> on
>> PCs with Office 2002. Will this work or do I have to reference "Microsoft
>> Excel 10.0 Object Library" in that case.
>>
>> Since I cannot reference "Microsoft Excel 11.0 Object Library" and
>> "Microsoft Excel 10.0 Object Library" at the same time, what is the best
>> way
>> making my application work with both versions of office?
>>
>> By the way: I would like to avoid using the CreateObject method since I
>> generally try to avoid late binding.
>>
> The best way to approach something like this is to program and test
> against the
> oldest application version. Often, the newer version will pick up a
> reference
> to the newer library. And backwards compatibility should be more or less
> OK.
> Going the other way is always dangerous because you don't know if what
> you're
> doing is even supported in the older version.
>
> Actually, Microsoft recommends creating a separate solution for each
> Office
> version. Or using late binding.
>
> There is no way to "trick" your assembly into referencing an object
> library
> that's not present on the development machine. So the "best answer" to
> your
> question is to obtain Office XP and install it on a separate machine or a
> virtual machine for testing (and compiliation, if at all possible).
>
> Cindy Meister
> INTER-Solutions, Switzerland
>
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
>
http://www.word.mvps.org >
> This reply is posted in the Newsgroup; please post any follow question or
> reply
> in the newsgroup and not by e-mail :-)
>