Running Excell methods

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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,null,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.
 
C# does not support optional parameters so you need to supply every
parameter to method.
What is the question?
 
After I posted this question I found an answer: I added a VB project which
serves as an intermediae connection between C# and Excel.
 
Back
Top