4 ms·
Is there any open source implementation of VBA one can add to some application with limited effort? I'm thinking about adding macro-like functionality to one of
by zxspectrum1982 3y ago
Is there any open source implementation of VBA one can add to some application with limited effort? I'm thinking about adding macro-like functionality to one of my business applications and VBA would be the best, considering my users and Excel users intersect pretty well.
- amichal 3y agoI dont know about open source. But back back around 2000 it was fairly common to implement a "VBA host". It was also easy, a few dev days to scaffold and minutes to hours of dev time to expose functions. We did it with a suite of related applications (used internally by a early ebook punlisher) that interacted a lot with Office. Introspection, auto-complete and integrated help documentation all worked and technically minded editor staff could automate lots of thier work with Visual Studio provided IDE and debuggers etc
- doubloon 3y agoIMHO the trick is that any moderately useful and modern VBA is likely to go way beyond the base specification. - UserForms GUI (which this does not touch on at all) - Microsoft libraries like mscorlib and Microsoft Scripting Runtime, to get stuff like ArrayList and FileSystemObject. - Excel VBA is kind of notorious for mixing Excel code with the VBA, using cells of the sheet as data storage, using formulas inside of cells to calculate values, etc. For example to store a list of values and sort it, they might put the data into a tab of the spreadsheet and call Excel functions to sort it inside the spreadsheet instead of building a list in VBA and sorting it in VBA. So I think an open source useful VBA clone would probably also need to be an Excel clone and also a clone of a bunch of Microsoft libraries
- mcbishop 3y agoI love your comment. I'm guessing that it'd be very difficult to clone Excel's relatively-new dynamic-array-formula functionality (with comparable performance).
- agumonkey 3y agoand IIRC, datatype conversion made through excel formatting options. change cell display to get decimal :) fun
- mcbishop 3y agoI'm pretty sure that modifying a cell's number format never affects the underlying value.
- agumonkey 3y agomaybe not the actual memory data, but AFAIK it does affect the behavior of other logical / arithmetic functions in strange ways
- deleted 3y ago[deleted]
- mcbishop 3y agoOkay, thanks. If this is correct... it's unsettling and not cool.
- doubloon 3y agothere are excel parsing libraries will treat the underlying data differently depending on how it is formatted. operations people basically have to do workarounds for this all the time.
- giancarlostoro 3y agoNot open source, but VBScript used to be embeddable in VB6 apps, I think VB.NET might have had something too?
- pjmlp 3y agoYes, you can host .NET runtime into another application. https://learn.microsoft.com/en-us/dotnet/core/tutorials/netcore-hosting https://learn.microsoft.com/en-us/dotnet/core/tutorials/netc...
- giancarlostoro 3y agoYeah but my confusion now comes from the fact that I don't think VB is even updated by MS anymore.
- pjmlp 3y agoKind of, it is still updated to keep being used in .NET latest, and at very least consume newer APIs, and profit from runtime improvements. Much better position than VB 6.
- giancarlostoro 3y agoFair! I just assume its basically the slowest phasing out. It's a shame, VB6 was my first language, and I had strong hopes for VB .NET but having access to C# makes VB feel pointless, especially since it won that "language war" essentially. I do hope one day Microsoft open sources VB6. I think it would be quite an interesting thing to see.
- johannes1234321 3y agoNot open source, but if you are ein Windows, youncnanuse the Windows Script Host via COM: https://learn.microsoft.com/en-us/previous-versions//a74hyyw0(v=vs.85)?redirectedfrom=MSDN https://learn.microsoft.com/en-us/previous-versions//a74hyyw...
- daniel-s 3y agoDoesn't Libreoffice have an implementation of VBA?