473,466 Members | 1,402 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Supporting Multiple Versions Of Excel

I am automating Excel 2000 using the COM interop. I have noticed that the
application doesn't run with Excel 97. I want to write just one piece of
code which will work with both Excel 2000 and Excel 97. How can I do this
when they have different type libraries ? I could dynamically load the
relevant type library (i.e. Excel 2000 or Excel 97) on the target machine
and create my necessary objects (i.e. ExcelApplication and ExcelWorkbook)
using Activator.CreateInstance but this will return a System.Object. I think
that I would be unable to cast it into something useful (like an
ExcelApplication or ExcelWorkbook) because these types are dynamically
loaded from the type library.

Inpiration desired.

Nick Carter
Nov 22 '05 #1
3 2231
When creating an Office app that is to run on multiple versions, you have
two choices:

1. Build the app using the earliest library you wish to support.
2. Use late binding.

--
http://www.standards.com/; See Howard Kaikow's web site.
"Nick Carter" <ni***@dontspamme.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
I am automating Excel 2000 using the COM interop. I have noticed that the
application doesn't run with Excel 97. I want to write just one piece of
code which will work with both Excel 2000 and Excel 97. How can I do this
when they have different type libraries ? I could dynamically load the
relevant type library (i.e. Excel 2000 or Excel 97) on the target machine
and create my necessary objects (i.e. ExcelApplication and ExcelWorkbook)
using Activator.CreateInstance but this will return a System.Object. I think that I would be unable to cast it into something useful (like an
ExcelApplication or ExcelWorkbook) because these types are dynamically
loaded from the type library.

Inpiration desired.

Nick Carter

Nov 22 '05 #2
Howard,

I'm using C# so option 2 is problematic but feasible.

Thanks.

Nick

"Howard Kaikow" <ka****@standards.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
When creating an Office app that is to run on multiple versions, you have
two choices:

1. Build the app using the earliest library you wish to support.
2. Use late binding.

--
http://www.standards.com/; See Howard Kaikow's web site.
"Nick Carter" <ni***@dontspamme.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
I am automating Excel 2000 using the COM interop. I have noticed that the application doesn't run with Excel 97. I want to write just one piece of
code which will work with both Excel 2000 and Excel 97. How can I do this when they have different type libraries ? I could dynamically load the
relevant type library (i.e. Excel 2000 or Excel 97) on the target machine and create my necessary objects (i.e. ExcelApplication and ExcelWorkbook) using Activator.CreateInstance but this will return a System.Object. I

think
that I would be unable to cast it into something useful (like an
ExcelApplication or ExcelWorkbook) because these types are dynamically
loaded from the type library.

Inpiration desired.

Nick Carter


Nov 22 '05 #3
Using the earliest library is best and is recommended by Microsoft,

--
http://www.standards.com/; See Howard Kaikow's web site.
"Nick Carter" <ni***@dontspamme.com> wrote in message
news:u$**************@tk2msftngp13.phx.gbl...
Howard,

I'm using C# so option 2 is problematic but feasible.

Thanks.

Nick

"Howard Kaikow" <ka****@standards.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
When creating an Office app that is to run on multiple versions, you have
two choices:

1. Build the app using the earliest library you wish to support.
2. Use late binding.

--
http://www.standards.com/; See Howard Kaikow's web site.
"Nick Carter" <ni***@dontspamme.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
I am automating Excel 2000 using the COM interop. I have noticed that

the application doesn't run with Excel 97. I want to write just one piece of code which will work with both Excel 2000 and Excel 97. How can I do this when they have different type libraries ? I could dynamically load the
relevant type library (i.e. Excel 2000 or Excel 97) on the target machine and create my necessary objects (i.e. ExcelApplication and ExcelWorkbook) using Activator.CreateInstance but this will return a System.Object. I

think
that I would be unable to cast it into something useful (like an
ExcelApplication or ExcelWorkbook) because these types are dynamically
loaded from the type library.

Inpiration desired.

Nick Carter



Nov 22 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Nick Carter | last post by:
I am automating Excel 2000 using the COM interop. I have noticed that the application doesn't run with Excel 97. I want to write just one piece of code which will work with both Excel 2000 and...
6
by: Richie | last post by:
I went through the past six months or so of entries in c.l.javascript, and found a couple where people had expressed opinions about the value of supporting much older versions of Netscape and IE. ...
1
by: (Pete Cresswell) | last post by:
I'm debugging an app that has a Reference to Excel 9.0 (i.e. Office 2000's Excel). A guy who is trying to test it for me has Office 2003 (Excel 10? Excel 11?) installed on his PC and the most...
9
by: Maik | last post by:
Hello, I've developed an assembly, which opens an excel workbook and readout the range names and -values. I'm working with Office XP on my computer. I want to deploy this assembly on computers,...
11
by: BrianDH | last post by:
Hi Is there a way, in VB.Net, to write a windows based program that will use more than one version of Office (Excel)? Example: if office 2000 then else if office 2003 then. Is this possible? ...
3
by: Michael Kellogg | last post by:
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: ...
0
by: luistrigueiros | last post by:
Hi list, At the moment at work I have to maintain one Excel spreadsheet that has plenty of VBA code that performs validation of the data the user inserts, it must conform to certain business...
3
by: sejal17 | last post by:
hello Can any one tell me how to read multiple worksheets from a single excel file.I have stored that excel in xml file.so i want to read that xml that has multiple worksheet.And i want to store...
3
by: sejal17 | last post by:
hello Can any one tell me how to read multiple worksheets from a single excel file.I have stored that excel in xml file.so i want to read that xml that has multiple worksheet.And i want to store...
5
by: Bill Schanks | last post by:
I have a winform app (VB 2005) that allows users to export data to excel, make updates to the excel file and import the data from that Excel file and update the database. My question is: Is it...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.