Coder Social home page Coder Social logo

exceldna.com.quickstart's Introduction

ExcelDna.COM.QuickStart

Author @Daniel NGUYEN July 27th 2017 EXCEL DNA COM Sample : Generation of an XLL file to be used in VBA

  1. Check post build event of project "DataApiAddin": it will generate tlb files, then build a DataApiAddin-packed.xll.

  2. Open Excel, load the DataApiAddin-packed.xll.

  3. Or, Open Excel, Tools > References > Browse in order to add DataApiAddin-packed.xll Not the tlb but the .xll. DataApiAddin-packed.xll can be added because of the following Pack="true" in DataApiAddin.dna file:

<ExternalLibrary Path="DataApiAddin.dll" ComServer="true" Pack="true" />

tlb could be added but it is not the purpose.

  1. Alt+F11 Add a module and the following code:
Public Sub Test()
    Dim api As New COMDataManager
    Dim res As String    
    res = api.GetHello("2017")
    MsgBox (res)
End Sub

' These work only after the COM Server has been registered ' either by calling ExcelDna.ComInterop.ComServer.DllRegisterServer() ' (like from a macro or AutoOpen routine in the Excel-DNA addin) ' or by calling "regsvr32 DataApiAddin-packed.xll" from a command prompt (once, before opening Excel).

Check ExcelAddin.cs class : use of AutoOpen routine
  1. Press F5 to check the result

  2. Additionnal: Check sample codes for details https://github.com/Excel-DNA/ExcelDna

ExcelDna-master\ExcelDna-master\Distribution\Samples\ComServer 

exceldna.com.quickstart's People

Contributors

danmgs avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.