chelh / vbasync Goto Github PK
View Code? Open in Web Editor NEWCross-platform tool to synchronize macros from an Office VBA-enabled file with a version-controlled folder
License: Other
Cross-platform tool to synchronize macros from an Office VBA-enabled file with a version-controlled folder
License: Other
Hello!
I wish I could try your utility, but I don't have VS or any other C# compiler installed.
Could you also please publish a pre-built executable file for the tool?
Thanks!
Hello,
I was testing your software this evening, and found a bug (using version 1.1.4). Here is the scenario:
I created a XLSM file containing a Module, a class and a UserForm (with a button). On scenario start, the XLSM file is opened.
If you're unable to reproduce the problem, I'll be able to provide my sample XLSM file.
Hi chelh,
Another idea, related with issue 24, I would find useful to be able to ignore files without VBA code in them (as an option in settings panel), in the Office File, and in the Source Folder. As a side-benefit, the list of extracted files would be smaller to the only necessary files.
What do you think?
Hi chelh,
I noticed that extracting twice the same form doesn't generate the same frx file.
Thx
Hello,
I noticed that the merge tool works only if the path is not given between quotes. I copied/pasted the path from a shortcut, and I've just found out today what the problem was.
Identified in 1.3.0 RC (don't remember which one)
I have a Word template containing some forms in my .dotm file.
I have extracted my .dotm file into a folder from which I am committing the code to SVN.
When I make changes to the code for the form, I am able to successfully extract the '.frm' files with the code.
However, when I make any UI changes in a form, and try to extract them, I am getting an error as shown in the screenshot.
Error: 'File name cannot be null. Parameter name: sourceFileName'
I had to extract the template to a different folder to get around this issue temporarily.
p.s. I feel the buttons 'Apply' and 'OK' may not be correctly named, as both of them extract the files from the template. I happen to keep the tool open to extract multiple times while I am coding.
Hi anew,
Would it be possible to differentiate the extracted and the published office document. And even a root "template" office document.
That's to say for example that we conceive the office document in a working directory c:\whatever\work.
That the source code repo is in another directory c:\src\awesomeprojectrepo.
And finally, as we do not want any change in the styles of the document happening during the "conceive" phase, we'd like that the publish starts from a "template" office document (note also that this document may or may not already contains the vba content).
So we'd have 3 files and 4directories
c:\whatever\work\source.doc -> the source document to extract from
c:\src\awesomeprojectrepo\bin\target.doc -> the target document to publish to
c:\src\awesomeprojectrepo\src\ -> the source/target directory to extract-to/publish-from (including the ini file)
c:\src\awesomeprojectrepo\template\template.doc -> the root template document to publish from
Thx
For some reason if the BIFF file name case does not match the declared file name, the following code in VbaFolder.cs throws an exception
case "CLASS":
modules.First(m => m.Name == split[1]).Type = ModuleType.Class;
This can be remedied by uppercasing everything, or doing a case insensitive match
Please comment or emote here if you'd like me to find some way to get VBA Sync Tool working as a command-line executable under Linux, in addition to the normal Windows GUI. I've tried a couple of approaches already, and would like to gauge the actual level of interest in this before pursuing it further.
It would be useful to have a command line version that can be run from a batch file. Extraction can ignore diffs by default as we are expecting to extract into a version-controlled folder. The publish can be like a compile step, merging the source files into a binary file.
Hi chelh,
If recent files are specified as relative path in Lastsession.ini, they are not loaded.
Tested in version 2.0.1
With many VBA form–containing Office files, each time the Office file is saved, VBA Sync Tool generates a slightly different .frx
file, even if the form design doesn't actually change. Inspection with a hex editor suggests that when Office embeds the .frx
data into the file, for each control name that it writes, it inserts some uninitialized bytes to make the next field align to a 4-byte boundary. VBA Sync Tool needs to compensate for this by overwriting the padding bytes to null.
Hi chelh,
I noticed that if you load a session, and file or folder doesn't exist anymore, there is no alert to the user (maybe apply would display a message, I didn't test).
I would suggest something like this:
The ListView kept the list from previous session, so depending on your implementation, there might be a risk to publish or extract files from previous session instead.
Thanks!
When opening one specific project folder I get this error message:
Error reading 'o' stream in .frx data: expected cbMorphData size 24, but actual size was 28.
See also MorphDataControl.cs
Other project folders with .frx files work just fine.
Edit: This is on version 1.1.4
This does not seem to work. the list of files does not show up from folder.
Upon refresh get the error as below
"Error reading 'f' stream in .frx data; expected cbForm size 48, but actual size was 68.
Hello Chelsea!
First of all, great idea with VBASync, and thanks for sharing it with us! :)
I recently downloaded and compiled VBASync under VS2015 -- I'm not using C# 7.0, so had to make some changes around properties with "=>" and TryParse(..., out var s). My changes are purely around the syntax of C# 7.0, so no scope or logic has been changed.
I'm able to extract out VBA code from a test spreadsheet (simple HelloWorld function in a module), but not able to push back any changes -- I can see that the timestamp of the spreadsheet changes, so VBASync is writing changes to the spreadsheet. Clicking on the Refresh button on the VBASync gui, will show that there are changes to the module.
I've attached the solution with my changes.
vbasync.zip
Can you take a look to see what's going on?
Many thanks!
simon
PS. Some unit and integration tests would be great
I also would suggest that you split VBASync project. I envision a splitting in 3:
And as the libraries could be uses not only in VBASync, we also could imagine creating another repo...
Best regards.
BB
Hi chelh,
I work with several versions of files, with different worksheets, and same VBA code. I published a worksheet that didn't exist in the Office file. It gives the following result:
You can notice the icon related to Feuil4, and the (Name) property that doesn't match (actually, it is "ThisWorkbook"), and the worksheet can't be deleted.
Thanks!
Hi chelh,
Thx for this wonderfull tool. I did the same in the lame way using automation :-( . You win by KO ;-) .
What I think would be usefull for everyone is to support subdirectories in the extract/publish directory. That is to say, that in our office project we have tens of modules classes and forms. So It would be nice to kinda sort them in the subdirectories Modules, Classes, Forms (or other as any user would want).
So when extracting/publishing VBASync would scan the subdirectories of the project directory and try to find the equivalent file to be extracted/published.
For instance, at the first extraction VBASync would extract everything in the root directory. So then the user will reorganize the files as he wants. And then VBASync would respect the arrangement done by the user.
Thx again.
Hi chelh,
I saw a few issues about publish problems (already fixed). If after an extract or publish, you refresh the list - not as it "should be", but using the standard refresh - without selecting any item, I think you'll get the same result in most cases, but if some new extract/publish issue appears, then the user will see that as an extract or publish problem.
What do you think?
Hi chelh,
With the following scenario, language is not correctly taken into account:
The LastSession.ini file is as follow
LastSession.ini.txt
You can see that Language field is empty.
As a result, on my french OS, when I wanted to keep "english" for screenshots, the default french language was used.
=> Maybe, if possible, set the Language value as the OS language if available (but definitely not mandatory)
Thank you very much, and sorry for reporting so many issues today :-)
Hi there,
So the good news is v.2.0 kicks a**! It's publishes and extract's VBA to the SVN.
However, since v2.0 I noticed that publishing will something delete VBA script from the SVN, even though I've cleared deselected that I didn't want files deleted. Same for extracting, files will disappear from the SVN randomly. Not sure if it's settings (checkbox) not being propagated, or mismatch on matching up the SVN files to the ones on the Excel/Office file.
Let me know if you need me to run some test cases :)
Thanks again for this great tool, I'm contemplating installing VS to help debug/code!
First, thanks @chelh for such a fantastic tool, I use VBASync almost daily!
This is a feature request to integrate "GistThat" by @brucemcpherson into VBASync.
I totally understand if this is beyond the scope of what you are interested in including, it just seems like a natural fit with VBASync. VBASync already has the entire framework for extracting and updating code, this would just add the capability to pull updates from GitHubGist snippits to keep reusable VBA code up to date.
GistThat requires that Excel trust settings be modified and also runs from within Excel, both of which VBASync masterfully does not . VBASync could perform the same function that the GistThat bootstrap code in gistThat_.vba does, or even just a subset of it would be very useful.
Thanks for the consideration!
-Van
this tool is work,but Chinese garbled
how to change? help me!
Another idea for improvement:
That would be even more user friendly to have access of recently stored sessions from the "File" menu (5 last stored sessions for example).
I'm pretty sure there is a workaround using the new command line options of 1.2.0 and windows shortcuts, but I will surely take advantage of that new feature.
Thanks!
---------------------------
VBA Sync Tool
---------------------------
Error reading 'o' stream in .frx data: expected cbArrayString size 164, but saw 84 bytes as read.
---------------------------
ОК
---------------------------
Maybe this has something to do with national characters in paths and/or in form properties.
This is a critical bug since the utility can't proceed any further.
Hi chelh,
If recent files are specified as relative path in Lastsession.ini, they are not loaded.
Tested in version 2.0.1
Hello chelh,
Thanks for the portable version of 1.2.0. The version even solved another issue I didn't have time to report. I would ask for an extra improvement for the portable version, so that it really becomes a portable version (without extra data outside the current application folder).
Let me know if this can be done without too much troubles.
Hello,
Tested on version 1.1.6b (and 1.1.4), if I specify a diff tool and close VBASync, then the options are empty again when I start VBASync again.
Hello chelh,
Now that you almost fixed my last enhancement request, I thought of another one ^^. I would use a setting to save recent list item as relative path (relative from the application folder).
Ideally, that would manage relative path like ..\Sessions\SessionFile.ini (if the file is located in a folder next to the VBASync folder), or just relative folder from the application folder (like SessionFile.ini or Sessions\SessionFile.ini for a file located in a subfolder named Sessions). In short, that's the DOS way to define relative path.
You could either specify an option (in VBASync.ini file for example), or detect if the folder is relative or not (better if possible ^^).
And thanks again, you're always pretty efficient in taking my requests into account
VBA Sync is now public domain software. Any new authors please use this thread to advertise your version.
To build the project, you will need Visual Studio 2017 or later. Also download VBACompressionCodec.dll
to the src
directory.
Are you able to translate VBA Sync into another language? If so, you can help the project by following these steps:
src/VBASync/Localization/VBASyncResources.resx
.resx
to me, either via pull request or by posting it right here.Translators will be given credit in LICENSE.txt
and the project's GitHub page.
Thanks in advance!
Hi chelh,
Could you add the possibility to set office file and VBA Folder using drag and drop from explorer ?
Thanks
Add support for extracting and publishing VBA from/to Access databases (.mdb
and .accdb
).
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.