Migrating an Excel VBA Add-in to a VB.Net XLL with Excel-Dna: update

This document has now grown to a 51 page tutorial.  Comments and corrections are requested.

http://www.sysmod.com/vba-to-vb.net-xll-add-in-with-excel-dna.pdf

I am providing a free addin QualifyVBACode. It takes the VBProject in a workbook and qualifies the xl constants with their enum types, and prefixes ones like ActiveSheet with Application. The search/replace strings are in a XML key/value config file that you can edit. Of course, please read the ReadMe.txt file first after unzipping this (XLL, DNA, DLL, CONFIG) :

 http://www.sysmod.com/QualifyVBAcode.zip

Advertisement

About Patrick O'Beirne, Excel/VBA developer

Patrick provides consultancy and training in spreadsheet automation, data analysis, testing and model review; and the Excel spreadsheet auditing addin XLtest
This entry was posted in Excel/VBA, ExcelDna and tagged , , , . Bookmark the permalink.

17 Responses to Migrating an Excel VBA Add-in to a VB.Net XLL with Excel-Dna: update

  1. Govert says:

    This is growing into a very nice and comprehensive guide – thanks for the effort, Patrick!
    (There is something wrong with the link to the document – the displayed text is correct, but when clicked on it goes to some ftp site.)

  2. Pedie Nz says:

    Is Excel-Dna used along with Visual Studio?
    Do i need to install this separately? is it cost involved?

    • sysmod says:

      It can be used with full VS. Or, VS Express, or SharpDevelop, both free.
      This is explained in the document. Try the exercises in order and come back with any questions that need more explanation.

  3. Pingback: Moving on from Excel VBA to another programming language - what to choose? - Page 2

  4. Pingback: Excel DNA for C# – First functions | Capricorn Excel

  5. Pingback: Question Calling Dot Net code directly from a custom Excel "=" function

  6. fxkaiten says:

    Excellent guide. Thanks for creating it. I’m stuck on one bit though… In trying to debug a library by modifying the MyApp.vbproj.user file, I find that the contents of the file are completely different in my case from your example. Is this because I am using VS Express 2012? Appreciate it if you know what is different here. Thanks.

  7. That is the correct file, assuming the tags were removed by WordPress.
    To post code, there are guidelines in
    http://codex.wordpress.org/Writing_Code_in_Your_Posts

    I’ll use the pre and /pre tags here to test it:

    
    
      
        Program
        C:\Program Files\Microsoft Office\Office14\EXCEL.EXE
        CreateTOC.NET.xll
      
      
        ShowAllFiles
      
    
    
    • Ah, that test shows the pre tags did not help.
      Try again, in Notepad I replaced all open angle brackets with ampersand lt semicolon
      and right angle bracket with ampersand gt semicolon
      <?xml version=”1.0″ encoding=”utf-8″?>
      <Project ToolsVersion=”4.0″ xmlns=”http://schemas.microsoft.com/developer/msbuild/2003″>
      <PropertyGroup Condition=” ‘$(Configuration)|$(Platform)’ == ‘Debug|AnyCPU’ “>
      <StartAction>Program</StartAction>
      <StartProgram>C:\Program Files\Microsoft Office\Office14\EXCEL.EXE</StartProgram>
      <StartArguments>CreateTOC.NET.xll</StartArguments>
      </PropertyGroup>
      <PropertyGroup>
      <ProjectView>ShowAllFiles</ProjectView>
      </PropertyGroup>
      </Project>

  8. That worked. Must be an easier way to post literal markup in WordPress.

  9. Pingback: My First Custom Excel Ribbon using Excel-DNA – Site Title

  10. Pingback: My First Custom Excel Ribbon using Excel-DNA – Andy Sprague

  11. Pingback: The Excel-DNA | kumbukumbu

  12. Nsenor Udofa says:

    I am stuck at the beginning. I have followed your guide to create TestFuncs dll in Visual Studio 2015 on Windows 10 for Excel 2019 64 bit. The xll loads into Excel but the UDF do not appear. I have no idea what I’m missing. Thanks for any help.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s