{"id":14070858,"url":"https://github.com/spences10/VBA-IDE-Code-Export","last_synced_at":"2025-07-30T08:33:15.899Z","repository":{"id":43230037,"uuid":"53316794","full_name":"spences10/VBA-IDE-Code-Export","owner":"spences10","description":"Export \u0026 Import VBA code for use with Git (or any VCS)","archived":true,"fork":false,"pushed_at":"2022-09-01T07:24:57.000Z","size":28058,"stargazers_count":117,"open_issues_count":13,"forks_count":34,"subscribers_count":13,"default_branch":"main","last_synced_at":"2024-06-18T00:38:29.902Z","etag":null,"topics":["developer-ribbon","microsoft","vba","vba-ide","vba-modules","vcs","version-control","workbook","xml"],"latest_commit_sha":null,"homepage":"","language":"VBA","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/spences10.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-03-07T10:27:58.000Z","updated_at":"2024-06-12T10:51:05.000Z","dependencies_parsed_at":"2023-01-17T19:30:10.286Z","dependency_job_id":null,"html_url":"https://github.com/spences10/VBA-IDE-Code-Export","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spences10%2FVBA-IDE-Code-Export","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spences10%2FVBA-IDE-Code-Export/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spences10%2FVBA-IDE-Code-Export/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spences10%2FVBA-IDE-Code-Export/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/spences10","download_url":"https://codeload.github.com/spences10/VBA-IDE-Code-Export/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":215155197,"owners_count":15836926,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["developer-ribbon","microsoft","vba","vba-ide","vba-modules","vcs","version-control","workbook","xml"],"created_at":"2024-08-13T07:08:08.186Z","updated_at":"2024-08-13T07:17:45.338Z","avatar_url":"https://github.com/spences10.png","language":"VBA","funding_links":[],"categories":["VBA"],"sub_categories":[],"readme":"# VBA IDE CodeExport\n\n[![The MIT License](https://img.shields.io/badge/license-MIT-orange.svg?style=flat-square)](http://opensource.org/licenses/MIT)  [![Gitter](https://img.shields.io/gitter/room/nwjs/nw.js.svg?style=flat-square)](https://gitter.im/VBA-IDE-Code-Export)\n\n[![Average time to resolve an issue](http://isitmaintained.com/badge/resolution/spences10/VBA-IDE-Code-Export.svg)](http://isitmaintained.com/project/spences10/VBA-IDE-Code-Export \"Average time to resolve an issue\")  [![Percentage of issues still open](http://isitmaintained.com/badge/open/spences10/VBA-IDE-Code-Export.svg)](http://isitmaintained.com/project/spences10/VBA-IDE-Code-Export \"Percentage of issues still open\")\n\n[![Stories in Ready](https://badge.waffle.io/spences10/VBA-IDE-Code-Export.png?label=ready\u0026title=Ready)](https://waffle.io/spences10/VBA-IDE-Code-Export) [![Code Triagers Badge](https://www.codetriage.com/spences10/vba-ide-code-export/badges/users.svg)](https://www.codetriage.com/spences10/vba-ide-code-export)\n\n\u003c!-- TOC --\u003e\n\n- [VBA IDE CodeExport](#vba-ide-codeexport)\n  - [Intro](#intro)\n  - [Installing](#installing)\n  - [Usage](#usage)\n    - [The configuration file](#the-configuration-file)\n    - [Importing \u0026 Exporting](#importing--exporting)\n  - [Build from source](#build-from-source)\n    - [Clone the repo](#clone-the-repo)\n    - [Build the binary](#build-the-binary)\n    - [Add the code](#add-the-code)\n  - [Contributing](#contributing)\n  - [Roadmap](#roadmap)\n\n\u003c!-- /TOC --\u003e\n\n## Intro\n\nExport your excel VBA project source code for use with Git (or any VCS) from the\nExcel Developer ribbon, a pure VBA add-in for code export, no need to install a\nCOM add-in\n\nUse this add-in so that all the associated VBA files used in a VBA project\n(`*.cls`, `*.bas`, `*.frm` files) can be effortlessly exported for use with a\nVersion Control System.\n\nGot code in your `Worksheet` and `ThisWorkbook` modules? No problem! CodeExport\ntakes care of those too, exporting them as `*.sht` and `*.wbk` files :+1:\n\nThis is specifically for Excel, although the VBIDE extensibility can be used for\nall the MS Office suite.\n\n## Installing\n\n1. [Download](https://github.com/spences10/VBA-IDE-Code-Export/releases) the\n   add-in installer (e.g. `CodeExport_setup_1.2.3.exe`)\n2. Run the installer and follow the prompts.\n3. In Excel, Check the `Trust access to the VBA project model` check box located\n   in `Trust Centre -\u003e Trust Centre Settings -\u003e Macro Settings -\u003e Trust access\n   to the VBA project model`.\n\n## Usage\n\nAfter installing the add-in you will have the buttons for CodeExport in the\nExcel Developer ribbon. The add-in will also create a menu in the VBA IDE (the\nVBE) called `Export for VCS`. All controls for the add-in are found in these\nmenus.\n\n![](img/ribbon-buttons.png)\n\n### The configuration file\n\nA file named `CodeExport.config.json` in the same directory as an Excel file\ndeclares what gets imported into and exported from that Excel file. The `Make\nConfig File` button will create or update the configuration file automatically\nbased on the current contents of the active Excel file. The configuration file\ncan also be edited by hand in a text editor. This allows you to make further\nadjustments that the `Make Config File` button cannot do.\n\nThe configuration file is a plain text file using the JSON file format. Here is\nan example:\n\n```JSON\n{\n    \"VBAProject Name\": \"MyAwesomeProgram\",\n    \"Base Path\": \"src\",\n    \"Module Paths\": {\n        \"Sheet1\": \"Sheet1.cls\",\n        \"ThisWorkbook\": \"ThisWorkbook.cls\",\n        \"Module1\": \"Module1.bas\",\n        \"Class1\": \"my\\\\sub\\\\dir\\\\Class1.bas\",\n        \"Userform1\": \"C:\\\\my\\\\absolute\\\\path\\\\Userform1.frx\"\n    },\n    \"References\": [\n\t\t{\n\t\t\t\"Name\": \"Scripting\",\n\t\t\t\"Description\": \"Microsoft Scripting Runtime\",\n\t\t\t\"GUID\": \"{420B2830-E718-11CF-893D-00A0C9054228}\",\n\t\t\t\"Major\": 1,\n\t\t\t\"Minor\": 0\n\t\t}\n    ]\n}\n```\n\nAnother example can be found in the\n[comprehensive example project](test-projects/comprehensive).\n\nHere is what each configuration property declares:\n\n* `VBAProject Name` - The name of the VBAProject. Will be set on import. Must\n  not contain any spaces.\n* `Module Paths` - A file system path for every module that will be imported and\n  exported by CodeExport. These may be relative or absolute paths.\n* `Base Path` - A prefix to be prepended to all relative paths in\n  `Module Paths`.\n* `References` - A list of reference definitions. Each reference described will\n  be referenced on import and dereferenced on export.\n\n### Importing \u0026 Exporting\n\nThe `Import` button will:\n\n* Import all the modules specified in the `Module Paths` configuration property.\n  Existing modules in the Excel file will be overwritten.\n* Add all library references declared in the `References` configuration\n  property. Existing library references in the Excel file will be overwritten.\n* Set the VBAProject name as declared in the `VBAProject Name` configuration\n  property.\n\nThe `Export` button will:\n\n* Export all the modules specified in the `Module Paths` configuration property.\n  Existing files in the file system will be overwritten.\n* Dereference libraries declared in the `References` configuration property.\n\n## Build from source\n\n### Clone the repo\n\nClone the repo `git clone https://github.com/spences10/VBA-IDE-Code-Export`,\nnavigate to where you have cloned the code to, there you will find the\n`src/VBA-IDE-Code-Export.package` folder. This is the 'unpacked' version of the\nVBA-IDE-Code-Export Excel `.xlsm` binary (workbook).\n\n### Build the binary\n\nTo \"repack\" the binary, create an empty `.zip` file and name it\n`VBA-IDE-Code-Export`. Open the empty `.zip` file then drag and drop the\n**_contents_** of the `VBA-IDE-Code-Export.package` folder into the `.zip` file.\n\n\u003e Now [I'm assuming you're using Windows] if you have the Folder Options setting\nfor `Hide extensions for known file types` checked then this is the time to\nuncheck it.\n\n![](img/unhide-file-extensions.gif)\n\nRename the file extension on the newly created `VBA-IDE-Code-Export.zip` file\nfrom `.zip` to `.xlsm`. Acknowledge the dialog saying `if you change the\nextension bad things might happen` and you will have \"packed\" the binary, ready\nto add the VBA code to.\n\n![](img/build-from-source.gif)\n\n### Add the code\n\nThe VBA code and related information can be imported using an already installed\ncopy of CodeExport, or it can be done manually.\n\nAll the necessary configuration for CodeExport to build itself is already\nprepared in `src/CodeExport.config.json`. To perform the build:\n\n1. Make sure you have a recent release of CodeExport installed. Instructions for\n   installation can be found in the [Installing](#installing) section.\n2. Open the `VBA-IDE-Code-Export.xlsm` template binary.\n3. Use the CodeExport `Import` button to automatically import everything that is\n   required. Since two versions of CodeExport is open at once, there will be two\n   identical sets of buttons in the developer ribbon menu, and this can be\n   confusing. Only one of these sets of buttons will work. If in doubt, use the\n   menu available in the VBE, where there will only be one menu (for now).\n\nIf the automated method is not possible, everything can be done manually. The\nbest way to do this is to have the `VBA-IDE-Code-Export.xlsm` VBA IDE open in\none window then the file explorer open at the `src` folder in another window.\n\nMulti select the contents of the folder **_excluding\n`VBA-IDE-Code-Export.package` and `CodeExport.config.json`_** drag and drop into\nthe `VBA-IDE-Code-Export.xlsm` VBA IDE.\n\nAdd in the following references:\n\n1. Microsoft Scripting Runtime\n2. Microsoft Visual Basic for Applications Extensibility 5.3\n3. Windows Script Host Object Model\n4. Microsoft Shell Controls And Automation\n\nSet the VBAProject name to `CodeExport`.\n\nSave, Debug\u003eCompile the project then from the Immediate pane in the VBA IDE\nenter `auto_open` and hit return this should create the VBA IDE menu items,\nyou're ready to move onto **usage.**\n\n![](img/add-code.gif)\n\n### Build the installer\n\nInstructions for building the installer (e.g. `CodeExport_setup_1.2.3.exe`) can\nbe found at\n[doc/installer-build-instructions.md](doc/installer-build-instructions.md).\n\n## Contributing\n\nPlease fork this repository and contribute back using GitHub pull requests.\n\nAny contributions, large or small, major features, bugfixes, integration tests\nand unit tests are welcomed and appreciated but will be thoroughly reviewed and\ndiscussed.\n\n## Roadmap\n\n- [x] Add pretty ribbon UI\n- [x] Export XL as XML\n- [ ] Import XL from XML\n- [ ] Command line interface\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspences10%2FVBA-IDE-Code-Export","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fspences10%2FVBA-IDE-Code-Export","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspences10%2FVBA-IDE-Code-Export/lists"}