Getting the UDF Directory Pathname  
Author Message
Amzi!





PostPosted: SharePoint - Excel Services, Getting the UDF Directory Pathname Top

In my Excel Services UDF, is there a way to determine what the pathname of the directory the UDF dll was loaded from

SharePoint Products and Technologies4  
 
 
Luis Bitencourt-Emilio - MSFT





PostPosted: SharePoint - Excel Services, Getting the UDF Directory Pathname Top

Try

System.Reflection.Assembly.GetAssembly().CodeBase.Location

Or something under the Assembly reflection node should give it to you if that doesn't.

- Luis



 
 
Luis Bitencourt-Emilio - MSFT





PostPosted: SharePoint - Excel Services, Getting the UDF Directory Pathname Top

Did the answer above work out for you

If not please let us know so we can try and continue helping, otherwise, please mark it as the answer for the thread so we can get it off the radar.

Thanks!!



 
 
Amzi!





PostPosted: SharePoint - Excel Services, Getting the UDF Directory Pathname Top

I need some more help as this is new to me.

I'm using VB.NET and need the path in my New() method of my UDFClass().

How do I set an Assembly variable to the instance of the assembly

And what do I pass as the type parameter (required) to GetAssembly()

Thanks!


 
 
Amzi!





PostPosted: SharePoint - Excel Services, Getting the UDF Directory Pathname Top

Here's the solution from C# for anyone else who needs to do this:

strin udfpath;

udfpath = System.Reflection.Assembly.GetAssembly(this.GetType()).CodeBase;

It returns a URL of the form: file:///C:/dir/subdir/file.ext