473,656 Members | 2,762 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Excel 2000 COM object

I am having a problem with a program that I wrote to format an Excel
spreadsheet. I wrote the program on a WinXP/Office XP/Visual Studio .NET
2003 computer. I am using late-binding. When I try to run the program on a
Win2000/Office 2000 computer, it errs out during runtime. The error shows
that the parameters are incorrect for the Open statement. The problem that
I am having is that many of the Excel 2000 methods seem to take parameters
differently than Excel 2002 methods, even at the most basic level. For
example, this Open statement is what I use when compiling for Excel 2002:

internal object Open( object objBooks, string fileName )
{
object[] Parameters;
Parameters = new Object[15];
Parameters[0] = fileName;
Parameters[1] = Type.Missing;
Parameters[2] = Type.Missing;
Parameters[3] = Type.Missing;
Parameters[4] = Type.Missing;
Parameters[5] = Type.Missing;
Parameters[6] = Type.Missing;
Parameters[7] = Type.Missing;
Parameters[8] = Type.Missing;
Parameters[9] = Type.Missing;
Parameters[10] = Type.Missing;
Parameters[11] = Type.Missing;
Parameters[12] = Type.Missing;
Parameters[13] = Type.Missing;
Parameters[14] = Type.Missing;
return objBooks.GetTyp e().InvokeMembe r( "Open",
BindingFlags.In vokeMethod, null, objBooks, Parameters );
}

And, after experimentation , here is what I had to use to make it work with
Excel 2000:

internal object Open( object objBooks, string fileName )
{
object[] Parameters;
Parameters = new Object[1];
Parameters[0] = fileName;
return objBooks.GetTyp e().InvokeMembe r( "Open",
BindingFlags.In vokeMethod, null, objBooks, Parameters );
}

I am also having problems with the Range.Sort method and the Workbook.Close
method. All of these methods run just fine on the Office XP computer, but
they give me "Incorrect number of parameters" errors on the Office 2000
computer.

Has anyone had any experience passing parameters to the Excel COM object. Do
I need to use a different technique?

Thanks,
Dennis
Nov 15 '05 #1
0 1418

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

Similar topics

3
1215
by: Dean Bortell | last post by:
This code runs fine on win xp and office xp: string sheetPassword = "Senior1993"; string sheetToOpen = "NewRpt1c.xls"; Excel.Application excelApp = new Excel.Application(); excelApp.Visible=true; object spreadsheetFileName = Environment.CurrentDirectory + "\\" + sheetToOpen; Excel.Workbook excelWorkbook = excelApp.Workbooks.Open (Convert.ToString(spreadsheetFileName), 0,false,
1
858
by: Benjamin | last post by:
I am making a Windows EXE (.NET Visual Basic Windows Application). I would like to make it possible to open Excel Worksheets from my EXE. This should work independent of Excel version on client machine (it is out of my control to know what versions of Excel different users has.) Anyway let us say that Excel 2000 is the oldest acceptable version. I build the EXE on a PC with Excel 2000. But I it is not working on an Excel 2003 machine! ...
2
5687
by: Ian | last post by:
I have an Access97 database and I am trying to create an Excel sheet from a report within this database. I have the following code on the On Click event of a button on a form: ----------------------------------------------------- On Error GoTo ErrReport
2
1920
by: David Reynolds | last post by:
Hi Everybody, I have a vb.net webform where I create the Excel application/workbook/worksheet. On Windows 2000 server for some reason, I keep getting an error("Bad variable type") when trying to first set the value to a cell. I don't have the problem on 2003 server or XP, and I'm wondering if anyone knows of a get around on 2000? Try EApp = CreateObject("Excel.Application")
1
2565
by: Randall Arnold | last post by:
I'm converting a vbscript program to vb.net. Witht he exception of .net idiosyncrasies, most of it is working well with the same code. My only problem is that some properties and methods are missing from the Chart object. For instance, the following line worked fine in vbscript (csPowerSpeed is the chart): objXL.csPowerSpeed.seriescollection.newseries() However, in VS.Net, newseries is no longer avaialable as a method for series...
2
5614
by: James | last post by:
I am doing some Excel 2000 automaton using Vb 2005. I am referencing the Excel 9.0 COM Object Library. The following code was working fine: Dim xlApp as new Excel.Application Dim xlWb as Excel.Workbook Dim xlSheet as Excel.Worksheet xlWb = xlApp.Workbooks.Add
0
1747
by: jostein67 | last post by:
I have moved an ASP application to a new Windows server. Need to export data to Excel. Worked fine before. Not so anymore. Case: - Exporting data from ASP to Excel 2000, using Office Web Components. - Installed and reinstalled Excel, also checking that MSOWC.DLL is in the right spot on my disk. - Old server Win 2000/IIS 5, new server Win2003/IIS 6. - Have selected ALLOWED for all Web Extensions in IIS Manager (all ISAPI, all CGI, ASP,...
2
1636
by: smtwtfs007 | last post by:
Guys, I am having problems with Excel 2000 to Excel 2003 dll in production. I am having version 2003 in my PC and I used the below code change to open password protected excel files in my application. My application is in ASP.NET From: objExcel = New Excel.Application
0
1694
by: smtwtfs007 | last post by:
Guys, I am having problems with Excel 2000 to Excel 2003 dll in production. I am having version 2003 in my PC and I used the below code change to open password protected excel files in my application. My application is in ASP.NET From: objExcel = New Excel.Application
0
8297
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
8816
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...
1
8498
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7311
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6162
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
4150
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...
1
2726
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1930
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1600
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.