LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.vstudio.general,microsoft.public.dotnet.framework.interop,microsoft.public.dotnet.general,microsoft.public.office.misc,microsoft.public.excel.programming
external usenet poster
 
Posts: 43
Default How do I access different versions of Excel from one .NET executable?

I want to use Visual Studio (2008, writing in VB.NET) to create an
EXE file that will, among other things, read from and write to
Excel workbooks. In particular, I want the program to work whether
the machine has Office 2003 or Office 2007 installed. (Other
versions of Excel would also be nice -- in particular 2010, when
it comes out -- but those two are critical).

I have no trouble accessing Excel 2007 on my own PC; however when
I copy the EXE file to a PC with Office 2003 installed the program
fails when it hits the Excel access code. (Note that VB.NET programs
compiled on the other PC are able to read and write Excel 2003
files on that machine, so that's not the problem).

I do know something about PIAs, although perhaps not enough. My
project makes a COM reference to the Microsoft Excel 12.0 Office
Library, which allows it to access Excel 2007. I believe that to
access Excel 2003 I would need to reference the 11.0 library, which
doesn't exist on my machine, so I can't reference it. Even if it
did, I don't know if it's possible or would make sense to reference
both libraries in the same project.

So what do I do? My requirement seems very straightforward --
something that a lot of people would want to do. But I've looked
around a bit without finding a way to do it. Indeed, I've found
disturbing suggestions that I will need to compile a separate
version of my program for each version of Office I want to be
compatible with, which would be very unpleasant. (Just for starters,
since you can't have two versions of Office on the same machine,
I would need to get a second PC just for this!).

I am really hoping that Microsoft has not made my life that difficult.
So can anyone give me some advice, or point me to documentation
that might help me out?
--
John Brock


 
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 Do I Run An Executable from Excel? [email protected] Excel Programming 1 October 28th 08 05:09 PM
Excel into executable MrBT Excel Worksheet Functions 2 May 1st 08 03:05 AM
Reference different versions of Access Noemi Excel Programming 2 November 13th 07 06:31 AM
Can't load Excel Executable rickSA007 Setting up and Configuration of Excel 0 June 28th 06 11:50 AM
Excel file as an executable? James Excel Programming 4 September 7th 05 08:51 PM


All times are GMT +1. The time now is 06:21 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"