Excel Shared AddIn

M

malikirfan28

Hello,
I created a Excel Shared AddIn in C#.Net and register my custom
funciton with Excel like this.
[ClassInterface(ClassInterfaceType.AutoDual)]
public class RegisterFunctions
{
[ComRegisterFunction()]
public static void RegisterCustomFunction(System.Type type)
{
Registry.ClassesRoot.CreateSubKey(GetSubKeyName(type));
}
[ComUnregisterFunction()]
public static void UnregisterFunction(System.Type type)
{
Registry.ClassesRoot.DeleteSubKey(GetSubKeyName(type));
}
public static string GetSubKeyName(System.Type type)
{
string s1;
s1 = @"CLSID\{" + type.GUID.ToString().ToUpper() + @"}
\Programmable";
return s1.ToString();
}
public object FINValue(string tic, string mic)
{
//Now this function call DB and using "tic" and "mic", pull the
relevant numeric value and return it.
}

This is working perfectly. Now I have few more requirements.
1. I have added a Custom Toolbar button "Enable/Disable FINValue
function" and want to enable/disable call (function) accordingly.
Disable mean, function will not call DB and preserve previous value
even user press Ctrl + Shift + ENTER (or referesh the sheet).

2. If user has 100 functions on one sheet and the press Ctrl + Shift +
ENTER (or referesh the sheet) it take significant time (in seconds). I
am working with Local database (SQL Server 2005) and it does not take
too much time. How should I improve performance in this scenario?


Your prompt reply will be really appreciated. Thanks

Best Regards,
Malik Irfan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top