in Education by
I saw an article on creating Excel UDFs in VSTO managed code, using VBA: http://blogs.msdn.com/pstubbs/archive/2004/12/31/344964.aspx. However I want to get this working in a C# Excel add-in using VSTO 2005 SE, can any one help? I tried the technique Romain pointed out but when trying to load Excel I get the following exception: The customization assembly could not be found or could not be loaded. You can still edit and save the document..... Details: Type mismatch. (Exception from HRESULT: 0x80020005 (DISP_E_TYPEMISMATCH)) ************** Exception Text ************** System.Runtime.InteropServices.COMException (0x80020005): Type mismatch. (Exception from HRESULT: 0x80020005 (DISP_E_TYPEMISMATCH)) at Microsoft.Office.Interop.Excel._Application.Run(Object Macro, Object Arg1, Object Arg2, Object Arg3, Object Arg4, Object Arg5, Object Arg6, Object Arg7, Object Arg8, Object Arg9, Object Arg10, Object Arg11, Object Arg12, Object Arg13, Object Arg14, Object Arg15, Object Arg16, Object Arg17, Object Arg18, Object Arg19, Object Arg20, Object Arg21, Object Arg22, Object Arg23, Object Arg24, Object Arg25, Object Arg26, Object Arg27, Object Arg28, Object Arg29, Object Arg30) at ExcelWorkbook4.ThisWorkbook.ThisWorkbook_Startup(Object sender, EventArgs e) in C:\projects\ExcelWorkbook4\ExcelWorkbook4\ThisWorkbook.cs:line 42 at Microsoft.Office.Tools.Excel.Workbook.OnStartup() at ExcelWorkbook4.ThisWorkbook.FinishInitialization() in C:\projects\ExcelWorkbook4\ExcelWorkbook4\ThisWorkbook.Designer.cs:line 66 at Microsoft.VisualStudio.Tools.Applications.Runtime.AppDomainManagerInternal.ExecutePhase(String methodName) at Microsoft.VisualStudio.Tools.Applications.Runtime.AppDomainManagerInternal.ExecuteCustomizationStartupCode() at Microsoft.VisualStudio.Tools.Applications.Runtime.AppDomainManagerInternal.ExecuteCustomization(IHostServiceProvider serviceProvider) ************** Loaded Assemblies ************** JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
You should also have a look at ExcelDna - http://www.codeplex.com/exceldna. ExcelDna allows managed assemblies to expose user-defined functions (UDFs) and macros to Excel through the native .xll interface. The project is open-source and freely allows commercial use. Your user-defined functions can be written in C#, Visual Basic, F#, Java (using IKVM.NET), and can be compiled to a .dll or exposed through a text-based script file. Excel versions from Excel 97 to Excel 2007 are supported. Some advantages of using the .xll interface rather than making automation add-ins include: older versions of Excel are supported, deployment is much easier since COM registration is not required and references to user-defined functions in worksheet formulae do not bind to the location of the add-in, and the performance of UDF functions exposed through ExcelDna is excellent.

Related questions

0 votes
    I ran into an issue when installing Team Foundation Server 2008 Workgroup Edition. I have a Windows Server ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 19, 2022 in Education by JackTerrance
0 votes
    I ran into an issue when installing Team Foundation Server 2008 Workgroup Edition. I have a Windows Server ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 19, 2022 in Education by JackTerrance
0 votes
    I have updated an Excel add-in that used to work fine apart from some new requirements. I've ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 2, 2022 in Education by JackTerrance
0 votes
    In Excel, which function returns the total of the range values? * O ADD() O &() O SUMC) Select the correct answer from above options...
asked Dec 31, 2021 in Education by JackTerrance
0 votes
    I store many sub records as Map in the same top record, now I need remove some sub records ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 26, 2022 in Education by JackTerrance
0 votes
    Is there a way to utilise the GCC compiler whilst still being able to develop via the Visual Studio IDE ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 30, 2022 in Education by JackTerrance
0 votes
    Is there a way to utilise the GCC compiler whilst still being able to develop via the Visual Studio IDE ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 29, 2022 in Education by JackTerrance
0 votes
    Is there a way to utilise the GCC compiler whilst still being able to develop via the Visual Studio IDE ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 27, 2022 in Education by JackTerrance
0 votes
    Has anybody attempted to pass a VBA (or VB6) function (via AddressOf ?) to the SQLite create a ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 25, 2022 in Education by JackTerrance
0 votes
    how can i create a script in which i can search someone number and it will provide me name, country, email in an ... is used in this) Select the correct answer from above options...
asked Dec 23, 2021 in Education by JackTerrance
0 votes
    how can i create a script in which i can search someone number and it will provide me name, country, email ... an excel file format Select the correct answer from above options...
asked Dec 23, 2021 in Education by JackTerrance
0 votes
    Which is the correct thermal stability order of H 2 E ( E = O , S , S e , T e H and P o ) P ? A. H 2 S e < ... 2 S e < H 2 S < H 2 O H Select the correct answer from above options...
asked Jan 2, 2022 in Education by JackTerrance
0 votes
    india ka Constitution konse laws kon si country se prarit ho kar liya hai Select the correct answer from above options...
asked Dec 22, 2021 in Education by JackTerrance
0 votes
    I want to add an event to the List generic class in C# in order to handle changing items of list ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 9, 2022 in Education by JackTerrance
...