ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Accessing WorksheetFunction.XX from regular C# Forms application (https://www.excelbanter.com/excel-worksheet-functions/30891-accessing-worksheetfunction-xx-regular-c-forms-application.html)

Jes Ramsing

Accessing WorksheetFunction.XX from regular C# Forms application
 
I have been trying all day to use the WorksheetFunction.Trend and other
functions from a regular Windows.Forms application.
I have O2003 with .net support installed and VS2003
in references I have Microsoft.Office.Interop.Excel and its included
references.
I can create An Excel.Application obejct ( apparently ) but as soon as I try
to access a WorksheetFunction.XX on it I get an Exception :

The following exception occurred:
System.Runtime.InteropServices.COMException (0x80028018): Old format or
invalid type library.
at System.RuntimeType.ForwardCallToInvokeMember(Strin g memberName,
BindingFlags flags, Object target, Int32[] aWrapperTypes, MessageData&
msgData)
at Microsoft.Office.Interop.Excel.WorksheetFunction.A tanh(Double Arg1)

I would like to utilize the power of Excel in my application - so please
give me a pointer to a solution...

Regards
/Jes - gone matchracing for the evening :-)


Jens Thiel

That's a known bug with a matching KB article. Your thread locale must match
Excel's language.

Best regards,
Jens.

--
http://ManagedXLL.net/ | http://www.stochastix.de/
Replace MSDN with my first name when replying to my email address!

"Jes Ramsing" <Jes wrote in message
...
I have been trying all day to use the WorksheetFunction.Trend and other
functions from a regular Windows.Forms application.
I have O2003 with .net support installed and VS2003
in references I have Microsoft.Office.Interop.Excel and its included
references.
I can create An Excel.Application obejct ( apparently ) but as soon as I
try
to access a WorksheetFunction.XX on it I get an Exception :

The following exception occurred:
System.Runtime.InteropServices.COMException (0x80028018): Old format or
invalid type library.
at System.RuntimeType.ForwardCallToInvokeMember(Strin g memberName,
BindingFlags flags, Object target, Int32[] aWrapperTypes, MessageData&
msgData)
at Microsoft.Office.Interop.Excel.WorksheetFunction.A tanh(Double Arg1)

I would like to utilize the power of Excel in my application - so please
give me a pointer to a solution...

Regards
/Jes - gone matchracing for the evening :-)





All times are GMT +1. The time now is 02:18 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com