Accessing custom document properties from and Excel UDF

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

Accessing custom document properties from and Excel UDF
 
Alessandro Di Bella




Posts: 2
Joined: 2014-01-20
Hi,

I'm trying to create a UDF as part of an excel add-in. Within the body of my function, I need to access the value of a custom property defined at workbook level but I don't seem to figure out how.

It is my understanding that the function itself has to be static so it does not have any access to the instance fields of the containing XLLModule.

I tried to initialize a static variable within OnInitialize but at they point where the handler is called the active workbook is not yet been set.

Any help would be greatly appreciated.

As a disclaimer I must say that I am very new to .NET so I apologise if the solution to the problem is obvious.

Regards,

Alex
Posted 20 Jan, 2014 07:15:11 Top
Andrei Smolin


Add-in Express team


Posts: 14115
Joined: 2006-05-11
Hello Alex,

Alessandro Di Bella writes:
Within the body of my function, I need to access the value of a custom property defined at workbook level


Are you talking about accessing Workbook.CustomDocumentProperties? Please check the section Determining What Cell / Worksheet / Workbook Your UDF Is Called From in the manual, see see the PDF file in the folder {Add-in Express}\Docs\ on your development PC.

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 20 Jan, 2014 10:16:59 Top