All Projects → spences10 → VBA-IDE-Code-Export

spences10 / VBA-IDE-Code-Export

Licence: MIT License
Export & Import VBA code for use with Git (or any VCS)

Programming Languages

vba
158 projects
pascal
1382 projects
Inno Setup
370 projects

Projects that are alternatives of or similar to VBA-IDE-Code-Export

Nbdime
Tools for diffing and merging of Jupyter notebooks.
Stars: ✭ 2,135 (+2298.88%)
Mutual labels:  version-control, vcs
Centraldogma
Highly-available version-controlled service configuration repository based on Git, ZooKeeper and HTTP/2
Stars: ✭ 378 (+324.72%)
Mutual labels:  version-control, vcs
Phpstamp
The XSL-way templating library for MS Office Word DOCX documents.
Stars: ✭ 150 (+68.54%)
Mutual labels:  microsoft, xml
Ansible Role Git
Ansible Role - Git
Stars: ✭ 153 (+71.91%)
Mutual labels:  version-control, vcs
powerbi-vcs
WIP (properly) version control and collaborate on your *.pbi{tx} files
Stars: ✭ 78 (-12.36%)
Mutual labels:  version-control, vcs
silver-platter
Automate the creation of merge proposals for scriptable changes
Stars: ✭ 19 (-78.65%)
Mutual labels:  vcs
dreamland world
DreamLand MUD: all configuration files, and some areas for local dev
Stars: ✭ 16 (-82.02%)
Mutual labels:  xml
MS-Office-Electron
A Microsoft Office Online Desktop Client made with Electron. Free of Cost.
Stars: ✭ 45 (-49.44%)
Mutual labels:  microsoft
blogspot-themes
Blogspot (Blogger) Themes Library
Stars: ✭ 32 (-64.04%)
Mutual labels:  xml
advxml
A lightweight, simple and functional library DSL to work with XML in Scala with Cats
Stars: ✭ 54 (-39.33%)
Mutual labels:  xml
folia
FoLiA: Format for Linguistic Annotation - FoLiA is a rich XML-based annotation format for the representation of language resources (including corpora) with linguistic annotations. A wide variety of linguistic annotations are supported, making FoLiA a useful format for NLP tasks and data interchange. Note that the actual Python library for proces…
Stars: ✭ 56 (-37.08%)
Mutual labels:  xml
utils.js
👷 🔧 zero dependencies vanilla JavaScript utils.
Stars: ✭ 14 (-84.27%)
Mutual labels:  xml
zwift-workout-file-reference
Reference documentation for the Zwift workout file format
Stars: ✭ 54 (-39.33%)
Mutual labels:  xml
lib12
lib12 is a library of universal helpers and extensions useful in any .NET project
Stars: ✭ 30 (-66.29%)
Mutual labels:  xml
Config
PHP library for simple configuration management
Stars: ✭ 39 (-56.18%)
Mutual labels:  xml
InshortApp
Demo app like inshort
Stars: ✭ 28 (-68.54%)
Mutual labels:  xml
php-hal
HAL+JSON & HAL+XML API transformer outputting valid (PSR-7) API Responses.
Stars: ✭ 30 (-66.29%)
Mutual labels:  xml
xgen
XSD (XML Schema Definition) parser and Go/C/Java/Rust/TypeScript code generator
Stars: ✭ 153 (+71.91%)
Mutual labels:  xml
snowfs
SnowFS - a fast, scalable version control file storage for graphic files 🎨
Stars: ✭ 1,101 (+1137.08%)
Mutual labels:  version-control
xrechnung-visualization
XSL transformators for web and pdf rendering of German CIUS XRechnung or EN16931-1:2017 [MIRROR OF GitLab]
Stars: ✭ 26 (-70.79%)
Mutual labels:  xml

VBA IDE CodeExport

The MIT License Gitter

Average time to resolve an issue Percentage of issues still open

Stories in Ready Code Triagers Badge

Intro

Export your excel VBA project source code for use with Git (or any VCS) from the Excel Developer ribbon, a pure VBA add-in for code export, no need to install a COM add-in

Use this add-in so that all the associated VBA files used in a VBA project (*.cls, *.bas, *.frm files) can be effortlessly exported for use with a Version Control System.

Got code in your Worksheet and ThisWorkbook modules? No problem! CodeExport takes care of those too, exporting them as *.sht and *.wbk files 👍

This is specifically for Excel, although the VBIDE extensibility can be used for all the MS Office suite.

Installing

  1. Download the add-in installer (e.g. CodeExport_setup_1.2.3.exe)
  2. Run the installer and follow the prompts.
  3. In Excel, Check the Trust access to the VBA project model check box located in Trust Centre -> Trust Centre Settings -> Macro Settings -> Trust access to the VBA project model.

Usage

After installing the add-in you will have the buttons for CodeExport in the Excel Developer ribbon. The add-in will also create a menu in the VBA IDE (the VBE) called Export for VCS. All controls for the add-in are found in these menus.

The configuration file

A file named CodeExport.config.json in the same directory as an Excel file declares what gets imported into and exported from that Excel file. The Make Config File button will create or update the configuration file automatically based on the current contents of the active Excel file. The configuration file can also be edited by hand in a text editor. This allows you to make further adjustments that the Make Config File button cannot do.

The configuration file is a plain text file using the JSON file format. Here is an example:

{
    "VBAProject Name": "MyAwesomeProgram",
    "Base Path": "src",
    "Module Paths": {
        "Sheet1": "Sheet1.cls",
        "ThisWorkbook": "ThisWorkbook.cls",
        "Module1": "Module1.bas",
        "Class1": "my\\sub\\dir\\Class1.bas",
        "Userform1": "C:\\my\\absolute\\path\\Userform1.frx"
    },
    "References": [
		{
			"Name": "Scripting",
			"Description": "Microsoft Scripting Runtime",
			"GUID": "{420B2830-E718-11CF-893D-00A0C9054228}",
			"Major": 1,
			"Minor": 0
		}
    ]
}

Another example can be found in the comprehensive example project.

Here is what each configuration property declares:

  • VBAProject Name - The name of the VBAProject. Will be set on import. Must not contain any spaces.
  • Module Paths - A file system path for every module that will be imported and exported by CodeExport. These may be relative or absolute paths.
  • Base Path - A prefix to be prepended to all relative paths in Module Paths.
  • References - A list of reference definitions. Each reference described will be referenced on import and dereferenced on export.

Importing & Exporting

The Import button will:

  • Import all the modules specified in the Module Paths configuration property. Existing modules in the Excel file will be overwritten.
  • Add all library references declared in the References configuration property. Existing library references in the Excel file will be overwritten.
  • Set the VBAProject name as declared in the VBAProject Name configuration property.

The Export button will:

  • Export all the modules specified in the Module Paths configuration property. Existing files in the file system will be overwritten.
  • Dereference libraries declared in the References configuration property.

Build from source

Clone the repo

Clone the repo git clone https://github.com/spences10/VBA-IDE-Code-Export, navigate to where you have cloned the code to, there you will find the src/VBA-IDE-Code-Export.package folder. This is the 'unpacked' version of the VBA-IDE-Code-Export Excel .xlsm binary (workbook).

Build the binary

To "repack" the binary, create an empty .zip file and name it VBA-IDE-Code-Export. Open the empty .zip file then drag and drop the contents of the VBA-IDE-Code-Export.package folder into the .zip file.

Now [I'm assuming you're using Windows] if you have the Folder Options setting for Hide extensions for known file types checked then this is the time to uncheck it.

Rename the file extension on the newly created VBA-IDE-Code-Export.zip file from .zip to .xlsm. Acknowledge the dialog saying if you change the extension bad things might happen and you will have "packed" the binary, ready to add the VBA code to.

Add the code

The VBA code and related information can be imported using an already installed copy of CodeExport, or it can be done manually.

All the necessary configuration for CodeExport to build itself is already prepared in src/CodeExport.config.json. To perform the build:

  1. Make sure you have a recent release of CodeExport installed. Instructions for installation can be found in the Installing section.
  2. Open the VBA-IDE-Code-Export.xlsm template binary.
  3. Use the CodeExport Import button to automatically import everything that is required. Since two versions of CodeExport is open at once, there will be two identical sets of buttons in the developer ribbon menu, and this can be confusing. Only one of these sets of buttons will work. If in doubt, use the menu available in the VBE, where there will only be one menu (for now).

If the automated method is not possible, everything can be done manually. The best way to do this is to have the VBA-IDE-Code-Export.xlsm VBA IDE open in one window then the file explorer open at the src folder in another window.

Multi select the contents of the folder excluding VBA-IDE-Code-Export.package and CodeExport.config.json drag and drop into the VBA-IDE-Code-Export.xlsm VBA IDE.

Add in the following references:

  1. Microsoft Scripting Runtime
  2. Microsoft Visual Basic for Applications Extensibility 5.3
  3. Windows Script Host Object Model
  4. Microsoft Shell Controls And Automation

Set the VBAProject name to CodeExport.

Save, Debug>Compile the project then from the Immediate pane in the VBA IDE enter auto_open and hit return this should create the VBA IDE menu items, you're ready to move onto usage.

Build the installer

Instructions for building the installer (e.g. CodeExport_setup_1.2.3.exe) can be found at doc/installer-build-instructions.md.

Contributing

Please fork this repository and contribute back using GitHub pull requests.

Any contributions, large or small, major features, bugfixes, integration tests and unit tests are welcomed and appreciated but will be thoroughly reviewed and discussed.

Roadmap

  • Add pretty ribbon UI
  • Export XL as XML
  • Import XL from XML
  • Command line interface
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].