Amzi!

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

Re: SharePoint - Excel Services Getting the UDF Directory Pathname

Luis Bitencourt-Emilio - MSFT

Try

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

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

- Luis






Re: SharePoint - Excel Services Getting the UDF Directory Pathname

Luis Bitencourt-Emilio - MSFT

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!!






Re: SharePoint - Excel Services Getting the UDF Directory Pathname

Amzi!

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!





Re: SharePoint - Excel Services Getting the UDF Directory Pathname

Amzi!

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