VSTO: calling excel funcions?

  • Thread starter Thread starter Lars Schouw
  • Start date Start date
L

Lars Schouw

How do I call funcions in my own add-in from C# using VSTO 2003?
Regards
Lars Schouw
 
Lars

More in hope than expectation as I am only skimming VSTO at the present (and
even then in VB.Net not C#), but if you have a pointer to the Excel
application object through the Office Interop structure then you should be
able to use the WorksheetFunction property of the Application object

xlApp.WorksheetFunction.Min(Range)

Note: Some functions are not available through this route for a list check
help in VBA for the property

--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
www.nickhodge.co.uk
(e-mail address removed)
 
Thanks Nick
How about by own VBA add-in functions like e.g.
=ChineseNewYear(1/5/2005) from my own add-in holidays.xla

Regards
Lars Schouw
 
I just found it you can use Application.Run( .... )

Runs a macro or calls a function.

Lars
 
Lars

Sorry didn't realise it was a UDF. You have the correct route to run any
code in Excel now...good luck

--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
www.nickhodge.co.uk
(e-mail address removed)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top