![]() |
Excel Shared AddIn
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(ty pe)); } [ComUnregisterFunction()] public static void UnregisterFunction(System.Type type) { Registry.ClassesRoot.DeleteSubKey(GetSubKeyName(ty pe)); } 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 |
All times are GMT +1. The time now is 12:13 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com