473,804 Members | 3,750 Online
Bytes | Software Development & Data Engineering Community
+ 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. ExcelApplicatio n and ExcelWorkbook)
using Activator.Creat eInstance but this will return a System.Object. I think
that I would be unable to cast it into something useful (like an
ExcelApplicatio n or ExcelWorkbook) because these types are dynamically
loaded from the type library.

Inpiration desired.

Nick Carter
Nov 22 '05 #1
3 2245
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***@dontspam me.com> wrote in message
news:%2******** ********@TK2MSF TNGP09.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. ExcelApplicatio n and ExcelWorkbook)
using Activator.Creat eInstance but this will return a System.Object. I think that I would be unable to cast it into something useful (like an
ExcelApplicatio n 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****@standar ds.com> wrote in message
news:%2******** ********@TK2MSF TNGP11.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***@dontspam me.com> wrote in message
news:%2******** ********@TK2MSF TNGP09.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. ExcelApplicatio n and ExcelWorkbook) using Activator.Creat eInstance but this will return a System.Object. I

think
that I would be unable to cast it into something useful (like an
ExcelApplicatio n 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***@dontspam me.com> wrote in message
news:u$******** ******@tk2msftn gp13.phx.gbl...
Howard,

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

Thanks.

Nick

"Howard Kaikow" <ka****@standar ds.com> wrote in message
news:%2******** ********@TK2MSF TNGP11.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***@dontspam me.com> wrote in message
news:%2******** ********@TK2MSF TNGP09.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. ExcelApplicatio n and ExcelWorkbook) using Activator.Creat eInstance but this will return a System.Object. I

think
that I would be unable to cast it into something useful (like an
ExcelApplicatio n 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
380
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 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)...
6
1999
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. The entries included incidental mention of server logs showing how many pages had been retrieved by such browsers. I'd like to get some sort of communal variety of opinions on how much effort it's worth to put in the support, or in some...
1
1732
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 I've gotten out of him so far is that "There's some kind of error". He'll be shipping me the error log, but it seems likely from here that the Reference to 9.0 is breaking on his PC.
9
12772
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, using excel version 97/2000/2002/2003. Is this possible and allowed, if I copy the PIA microsoft.office.interop.excel to the target computer? If not, do I need all Excel versions(pretty expensive)? Best regards
11
2744
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? Examples? Thanks
3
1981
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: Public Function ImportSis(ByVal strSisFile As String) As Boolean If m_Excel Is Nothing Then m_Excel = New Excel.Application End If
0
922
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 rules. I would like to replace the VBA code for one InPoc COM server DLL made in python. I read the Python Progamming on Win32 book, and I know that how to do this in python and to use py2exe to produce the DLL and how to register the COM server DLL...
3
6253
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 that multiple worksheet data in different table.How can i do it.Below is my xml file. <?xml version="1.0"?> <Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet" xmlns:o="urn:schemas-microsoft-com:office:office" ...
3
5403
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 that multiple worksheet data in different table.How can i do it.Below is my xml file. <?xml version="1.0"?> <Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet" xmlns:o="urn:schemas-microsoft-com:office:office"...
5
2916
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 best to do it this way, calling the update stored procedure for every update? Or should I be loading this data into a staging table, and if all goes well do the 'Real' Update. Or put this into a data adapter and update from that? The application...
0
9706
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9584
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10583
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10337
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10082
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7622
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5525
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5654
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2995
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.