Skip to content
Mohamad EL-Bawab edited this page Aug 30, 2014 · 22 revisions

To setup your development folders, we recommend the following structure: NumXL SDK for VBA
Where:

  • numxl-sdk-vba folder contains all source files for the VBA SDK Wrapper (i.e. NumXLAPI.xla)
  • output folder contains the executable binaries in NumXL and the SDK.
  • proj folder is where you maintain the source code for your custom application.

New Project

Open Microsoft Excel Application, and save the new spreadsheet to disk as macro-enabled workbook in the installation directory. NumXL SDK for VBA

Project References

Before we can start using the APIs, classes and the different types defined in the SDK, we need to add a reference to the SDK wrapper for VBA (aka NumXLAPI.xla).

  1. In Excel 2007 and later, enable the Developer tab (options --> Customize Ribbon). NumXL SDK for VBA
  2. Locate and open the visual basic editor. Visual Basic Editor
  3. From the Tools menu, click on the "References" item
    Locate the References menu item in VBA editor
  4. The Reference box pops up:
    References Dialog Box
  5. Click on the "Browse" button and navigate to the SDK installation directory.
  6. Select NumXLAPI.xla. Click "OK" and the library is added to the references (i.e. checked).
  7. Click "OK" and examine your VBA project explorer. The NumXL SDK (i,e, NumXLAPI.xla) is added and a new folder entitled "References" is added.

Initialization

Place an initialization and cleanup/shutdown source code in the workbook NumXL SDK for VBA

Example

In a user-module (e.g. Test), add a macro to query the machine ID text. NumXL SDK for VBA


Common Issues

  1. For NumXL VBA SDK to find and to load the different DLLs, the DLLs must be located either in a folder in your windows path or in the current directory. The SFSDK module has a procedure (ChgCurrentDirectory) to change the current directory, so this sub must be called before calling any APIs.
  2. When you try to save your spreadsheet, Excel triggers a privacy warning message. Excel privacy warning message

Clone this wiki locally