Maximus


Hi all,

[sorry for double posting]

I'm newbie to C# (I'm a Java developer) and I wonder if anyone can assist on this one.

I'm trying to implement an add-in to excel. I tried the example given at:
http://blogs.msdn.com/eric_carter/archive/2004/12/01/273127.aspx

all worked well but one minor issue: I can't get this - AutomationAddin.MyFunction on the insert Function Dialog.
* yes, I have it in my add-ins list just as the tutorial explains but not in the 'Insert Function' dialog.

does anyone know why and how can I solve it.
Thank you!


Re: Visual Studio Tools for Office Can't get the add-in work in excel

Dennis Wallentin

Hi,

It's difficult to give You any relevant input on the issue however can You enter the function's name into a cell






Re: Visual Studio Tools for Office Can't get the add-in work in excel

Maximus

no, I get the message: #NAME
do you have another idea
thank you.




Re: Visual Studio Tools for Office Can't get the add-in work in excel

Dennis Wallentin

Hi, if You have registrated the Automation Add-in it's remarkable that it's not available. Perhaps a 'stupid' question but has it been registrated




Re: Visual Studio Tools for Office Can't get the add-in work in excel

Maximus

Hi Dennis,
"....but has it been registrated "

mmm....I don't know. I just compiled the code and did just as instructed by the tutorial.
I thought that running the code will automatically register it (I have a DLL file ! !)

Am I missing something How can I make sure it is registered
thank you for your help

Code Snippet

[ComRegisterFunctionAttribute]
public static void RegisterFunction(Type type)
{
Registry.ClassesRoot.CreateSubKey(GetSubKeyName(type));
}

[ComUnregisterFunctionAttribute]
public static void UnregisterFunction(Type type)
{
Registry.ClassesRoot.DeleteSubKey(GetSubKeyName(type),false);
}

private static string GetSubKeyName(Type type)
{
string s = @"CLSID\{" + type.GUID.ToString().ToUpper() + @"}\Programmable";
return s;
}

[







Re: Visual Studio Tools for Office Can't get the add-in work in excel

Dennis Wallentin

As for the registration process:

With this code written, show the properties for the project by double clicking on the properties node under the project in Solution Explorer. Click on the Build tab and check the check box that says ˇ°Register for COM Interopˇ±. Then choose ˇ°Buildˇ± to build the add-in.






Re: Visual Studio Tools for Office Can't get the add-in work in excel

Maximus

ok, yes that specifies it in the tutorial. I did it....still cant get the function work properly.
maybe I'll try a diff tutorial, if you know one - please let me know.

thanks for your help