Skip to content

cavo789/vbs_xls_import_code

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Import code to Excel

Banner

Import external .bas, .cls and .frm files to an Excel workbook.

Table of Contents

Description

Using the vba_excel_export_code script, it's possible to export all codes from an Excel workbooks to files so it becomes easy to store code in versioning system like github.

This script will do the opposite: load external files to an Excel workbook. You can manipulate your codebase outside Excel (outside the old VBE editor), apply tools like prettiers, ... and import files back in Excel, for instance.

Install

Just get a copy of the .vbs script, perhaps the .cmd too (for your easiness) and save them in the same folder of your Excel application (containing the code you want to export).

Usage

Just edit the .cmd file and you'll see how it works: you just need to run the .vbs with one parameter, the name of the folder where your codebase is saved. Or, with a second parameter, the name of the file where code has to be imported.

demo

How to use

This script will ask up to two parameters:

  1. The folder where your codebase is saved
  2. An optional existing workbook filename where code will be imported.

Imagine you've your codebase saved in the c:\repository\my_application\src. There, you've .bas, .cls and/or .frm files that were generated by the vba_excel_export_code script.

To import them in a new Excel workbook just run this script like this:

cscript run.vbs c:\repository\my_application\src

By giving only one parameter, the source folder, a new, empty, Excel workbook will be created and files from c:\repository\my_application\src will be imported one by one.

You can specify a filename as a second parameter like below:

cscript run.vbs c:\repository\my_application\src app.xlsm

Here, the script will open the app.xlsm workbook (need to exists on disk) and import codebase it that file.

Author

Christophe Avonture

Contribute

PRs not accepted.

License

MIT

About

Import code to an Excel workbook, import .bas, .cls and .frm files

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published