Skip to content

VBA-tools2/IntelliSense_MacroOptions.vba

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

IntelliSense_MacroOptions.vba

Extend Excel-DNA’s IntelliSense with MacroOptions.

This repository shows a possible implementation to address Excel-DNA’s IntelliSense feature request to also use the .IntelliSense.xml file to add .MacroOptions (issue #119).

If you (@govert) like the code feel free to move it over to your repository or let me know if I should file a pull request.

Components

.vscode/cspell.json

Spell checker file for the Code Spell Checker extension for VS Code.

.vscode/ExcelDNA_IntelliSense.code-snippets

(User defined) code snippet file for VS Code to make it really easy to functions and their arguments to the XML file.

.vscode/settings.json

Useful settings for VS Code and the XML extension.

src/IntelliSense.xsd

XSD file to easier check if the XML file is valid (to use content for MacroOptions).

src/modIntelliSense_XML.bas

Module to extract the data from the XML file and to register the corresponding functions (using MacroOptions).

src/modProcessASOpen.bas

Module to check if there is an active sheet. (Only then no runtime error is thrown when MacroOptions is used.) (This is based on a file from Jan Karel Pieterse’s awesome code to Fix Links To UDFs in AddIns.)

src/modProcessAfterASOpen.bas

Module to run individual code after there is an active sheet.

tests/modIntelliSense_XML_Test.bas

Rubberduck’s (unit) test module to check if the modIntelliSense_XML.bas is doing what it should do.

tests/modMyTestFunctions.bas

Module with test functions (maybe it sounds familiar).

tests/MyTest.IntelliSense.xml

You should know that (too).

tests/MyTest.xlam

An example AddIn containing all relevant modules and the (unit) tests.

tests/XMLs folder

Contains the XML file for the unit tests.

Open points

  1. Because I don’t really have a clue how to test if functions are extracted correctly, most of the unit tests “just” cover error handling. Maybe one needs a fake/mock/stub. Do you have an idea?

  2. In the IntelliSense.xsd I couldn’t make the IntegerOrString simple type work for the Category argument (see the BUG: line in the code). Do you have an idea to make it work or is this impossible for union types (or maybe a bug in VS Code’s XML extension)? (Before creating this file I didn’t had any clue about XSD files …​)

  3. In the IntelliSense.xsd I used the names of the MacroOptions arguments. Thus, I used HelpFile instead of HelpTopic which you used in your example. → Rename one of them if the intension is the same.

FAQ

What are the '@... comments good for in the code?

You should really have a look at the awesome Rubberduck project!

License

MIT

About

Extend Excel-DNA’s IntelliSense with MacroOptions.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published