Accessing Excel Objects from UDF Functions

Add-in Express™ Support Service
That's what is more important than anything else

Accessing Excel Objects from UDF Functions
 
ctorres29




Posts: 23
Joined: 2008-09-08
Hi,

I am creating a XLL Functions using Visual Studio 2008. Is it possible to access Excel Objects? Specifically “Excel.names” where I have some constants values that I need to calculate the UDF.
I have been trying with something like this into my UDF Function:

Dim ExcelApp = CType(XLLBUcpFunciones.CurrentInstance.HostApplication, Excel.Application)
Dim Units As Double = ExcelApp.Names.Item("Units").Value

But it does not work.
My project is made with a COM Add-in and a XLL Module.

Any suggestion?

Thank's in advance

Posted 28 Oct, 2008 21:18:31 Top
Eugene Astafiev


Add-in Express team


Posts: 8540
Joined: 2007-07-25
Hi Carlos,

You can use the following constructions:

1. Module.CallWorksheetFunction
2. Module.ExcelApp
.NET, Extended MAPI, Windows Phone & RT
Posted 29 Oct, 2008 04:11:23 Top
Eugene Astafiev


Add-in Express team


Posts: 8540
Joined: 2007-07-25

BTW Module means a descendant of the AddinExpress.MSO.ADXXLLModule class.
.NET, Extended MAPI, Windows Phone & RT
Posted 29 Oct, 2008 04:13:09 Top