Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel Addin for .Net 2

Status
Not open for further replies.

piofenton

Instructor
Jul 12, 2002
33
IE
Ia ma trying to use a MS EXcel DataAnalysis tool through .Net as shown below. However I am running into a number of problems mainly though that the last line here expects 30 parameters, all bar one of which should be optional, and the compiler won't accept anything less. Plus these parameters are all generic object parameters with no indication as to their purpose. Does anyone know how to remedy this situation?
Basically I need to figure out how to properly employ the regression tool from Excel through C#.NET.
Thanks.


Code:
excelApp.AddIns.get_Item("Analysis ToolPak - VBA").Installed =true;
excelApp.Workbooks.Open(excelApp.LibraryPath + "\analysis\atpvbaen.xla",0, false, 5, "", "", false, Excel.XlPlatform.xlWindows, "", true, false, 0, true, false, false);
excelApp.Run("ATPVBAEN.XLA!Regress",
 
Optional parameters are not supported by C# (although they are by VB.Net.

You therefore have to provide a value for each one - generally something along the lines of 'null' will work (although if you know the datatype then a suitable default value would be better).


Hope this helps.

[vampire][bat]
 
I have lost some sleep and have balded slightly over this problem! My thanks! I love you people!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top