473,226 Members | 1,298 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,226 software developers and data experts.

Running Excell methods

When I run an Excel method, the C# compiler forces me to fill all the
optional parameters.
It looks like this
Excel.Run("AddSheets",null,null,null,null,null,nul l,null,null,null,null,null,null,null,null,null,nul l,null,null,null,null,null,null,null,null,null,nul l,null,null,null,null);
Originally, the AddSheet macro has no parameters.
This is a ridiculous example, but myWorkbook.SaveAs(excelName) does not work
too.

Jul 21 '05 #1
2 1110
C# does not support optional parameters so you need to supply every
parameter to method.
What is the question?

"gideonrv" <gi******@discussions.microsoft.com> wrote in message
news:5A**********************************@microsof t.com...
When I run an Excel method, the C# compiler forces me to fill all the
optional parameters.
It looks like this:
Excel.Run("AddSheets",null,null,null,null,null,nul l,null,null,null,null,null
,null,null,null,null,null,null,null,null,null,null ,null,null,null,null,null,
null,null,null,null); Originally, the AddSheet macro has no parameters.
This is a ridiculous example, but myWorkbook.SaveAs(excelName) does not work too.

Jul 21 '05 #2
After I posted this question I found an answer: I added a VB project which
serves as an intermediae connection between C# and Excel.

"Lebesgue" wrote:
C# does not support optional parameters so you need to supply every
parameter to method.
What is the question?

"gideonrv" <gi******@discussions.microsoft.com> wrote in message
news:5A**********************************@microsof t.com...
When I run an Excel method, the C# compiler forces me to fill all the
optional parameters.
It looks like this:

Excel.Run("AddSheets",null,null,null,null,null,nul l,null,null,null,null,null
,null,null,null,null,null,null,null,null,null,null ,null,null,null,null,null,
null,null,null,null);
Originally, the AddSheet macro has no parameters.
This is a ridiculous example, but myWorkbook.SaveAs(excelName) does not

work
too.


Jul 21 '05 #3

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

Similar topics

3
by: Savas Ates | last post by:
i cant delete data from excell which i use as a database with asp .. i encounter an error report about isam. how can i delete data from excell help meee!
2
by: alvis | last post by:
I need to write a windows service that will read a excell spreadsheet and either update a row in my sql db or insert the row. My question is how do i read excell spreadsheet row by row in VB dotnet
1
by: Mustafa | last post by:
I have an ASP script where i am generating the excell sheet dynamically i am passing some column header text which is long text so i want it to display it vertically in column (cell).In excell i...
1
by: Mustafa | last post by:
I have an ASP script where i am generating the excell sheet dynamically i am passing text as column heading which is long text so i want it to display it vertically in column (cell).In excell i...
2
by: Robert Halstead | last post by:
Hi guys, I have a asp.net web app and it's connecting to an excell 2003 document (in another folder) via OleDataAdapter. Everything works and all, it's just that when I shutdown IE and try to...
2
by: alvis | last post by:
hi i have a windows service that uses an excell workbook when i create the excell app i cant distroy it after i am finished i am using this code whats wrong? thanks Dim processes1(), p1 As...
0
by: Delforce | last post by:
Hi all, My application allows you to create a new excel file and then double click it in the list view to start it in excell. If the excell file is an existing one then I can start it now...
2
by: glibo | last post by:
I am trying to change the tab name when i open a excell spread sheet on the run time in c#. I changed it in the code: Response.AddHeader("content-disposition","filename=" + sFileName + ".xls");...
2
by: Bram2008 | last post by:
How to use macro in excel? Can i get some code to record excell data to vb? O y, i have project in vb, and i write data in vb, then i transfer it to excell to build chart. This is my code : ...
1
Ali Rizwan
by: Ali Rizwan | last post by:
Hi all, I m creating a database. The data for database will fetched from an excell sheet. Now how can i read an excell sheet and update my database with that excell sheet. Or I want to show...
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...

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.