toramameseven / vbe-client-mini

Vba module export, import extension for vscode.
MIT License
2 stars 0 forks source link
vba vscode

vbecm README

vbe-client-mini

This is vbe client mini. Vba module export, import extension for vs code. This extension thinks Excel as Excel Server.

日本語

animation

Requirement

Before use

Macro Settings

Set on next settings

vscode setting files.insertFinalNewline

You should better set setting files.insertFinalNewline On. When vbe imports a module ends with not a newline and exports it, the module is added a newline. So vbecm detect difference imported from exported.

vscode encoding

If your locale vbe encoding is not convertible to utf-8, you set properly vscode encoding for vba module. Do not use auto detect. For Japanese, if set auto detect, sometimes detect error occur.

exclude settings

You should better exclude the .base and .vbe folder at the explorer and the search.


"files.exclude": {
"**/.base": true,
"**/.vbe": true,
"**/.frx": true
},
"search.exclude": {
"**/.base": true,
"**/.vbe": true,
},

settings

Recommendation

if you need, it is better to install VSCode VBA below.

Features

Before use this extension, you must back up your xlsm or xlam file.

Explorer context menu for an xlsm and an xlam

Explorer context menu for a Src_[xxx.xlsm] folder

Explorer context menu for DIFF:

Modified modules are shown in the DIFF.

src(base)

If there is some modification in the src folder, the modified modules are shown. Vbecm checks the modification between the src and base folder.

You can click to compare the module in base and the module in the src.

You can right click to push the module to a Excel.

vbe(base)

If there is some modification in the VBE, the modified modules are shown. Vbecm checks the modification between the src and vbe folder.

You can click to compare the module in base and the module in the vbe.

The resolve command is removed on the latest version.

confilicting

When vbecm detects some confiliction between the source and the vbe, this tree is activate. Click this item, and show a diff tab between the source and the vbe. You edit the source and commit.

editor context menu

Folders

src_[excelBookName] folder

When you export modules, the modules are in the src_[excelBookName] folder.

.base folder

In the src[excelBookName] folder, you can see a .base folder. When you commit or import modules, this folder is updated. And when you export modules, vbecm tests if there are difference between the src[excelBookName] and .base folders.

.vbe folder

In the src_[excelBookName] folder, you can see a .vbe folder. When you commit or import modules or check modification, this folder is updated. And when you import modules, vbecm tests if there are difference between the .vbe and .base folders.

How to build

https://code.visualstudio.com/api/working-with-extensions/publishing-extension


npm install -g vsce
vsce package --target win32-x64
vsce publish

Known problems

Shallow dive

Not deep dive.

Sheet modules and Workbook modules

Sheet modules and Workbook modules are exported to [ModuleName].sht.cls. For vbecm distinguishes normal class modules from sheet(book) modules. Thanks for the VbaDeveloper

Opened excel file

While vbecm is working, Excel dose not close. Please close the Excel when you end using it.

For xlam file

When you use an xlam file, vbecm add a book to the excel instance.

Import frm

When you import a frm module, you find a extra line added. vbecm will delete the line.

Diff algorism

we are using the dir-compare and we are very grateful to be able to use it. https://github.com/gliviu/dir-compare And we want the option IGNORE CONTENT CASE, we fork and add some modification. We think there's probably a way to easily extend it without forking.

Release Notes

see change log