Here's a post from the Excel Liberation blog with an even simpler example. Prepare your workbook.Either create a new one, or use your existing workbook that you want to include the code in. Remember to trust access to the VBA project object model in the trust center. This is because we are going to automatically insert code into your workbook.Add gistThat bootstrap to your workbookThis gets in the code needed to modify your workbook automatically. You can get that here, Just paste it in to a new module, by convention called gistThat_Bring in required modulesThe modules required for this class documenter are defined in XML files, stored as a GIST. You need to execute this in the gistThat_ module, passing the gist IDs of the XML files, as follows. It will also set up the necessary references. From time to time you can rerun this, to get any new versions of any libraries I release. That's all that is needed. Public Function gtExampleLoad() ' this is an example of how you would load your VBE with a particular manifest ' you could set the 2nd parameter to overrride conflict checking the first time used- ' we are going to need cDataSet and cjobject stuff as well gtDoit "3414394", True ' this one loads the class serializer gtDoit "5028829", True End Function Now you can use the docProjects() sub of the classSerializer module to document your project. You can run gtUpdateAll() at any time to get the latest versions of all sources being managed by gistThat. A note about virus false positivesAny code that can modify the VBA excel codebase has the capability of introducing nasty code into your workbook. By its nature (it pulls code off the internet and inserts it into your workbook), along with the fact you've allowed it to do it, this bootstrap can look like a potential virus to some virus checkers. once you've updated your workbook with the latest modules, I recommend you
|
Services > Desktop Liberation - the definitive resource for Google Apps Script and Microsoft Office automation > Automatic documentation >