Live data from Hacker News

Visual Basic for Applications Language Specification [pdf]

msopenspecs.azureedge.net

11–20 of 40 posts

Re: Visual Basic for Applications Language Specification [pdf]

#11

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.

IMHO 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

Re: Visual Basic for Applications Language Specification [pdf]

#12

Earlier quoted context omitted.

I don't think VB6 (or really any prior VB) had a real spec, the language was basically QBASIC stitched on a form editor for VB1 and extended over time to add more stuff and after some point could also be embedded in other programs (hence "Visual Basic for Applications"). AFAIK this spec isn't even for VB6, but for a "VB7" (i.e. VB6 with a bunch of changes) that never really got a standalone version and Microsoft made…

I don't think so, or at least by VB5/6 they had moved on a long way. For instance VB6 compiled to native code rather than running as an interpreter. It could even create COM objects if you felt brave enough.

> It could even create COM objects if you felt brave enough.

Not just "brave enough" - but everyone, honestly. After VB4 and Windows 95, VB's raison d'etre was all about being a glue-language for anyone, regardless of ability level, to piece-together OLE/COM/ActiveX controls and components together onto a form/window surface and ship it the same day.

----

COM only requires bravery if you're lucky enough to be required to implement (or just consume), a COM service from C or a non-COM-blessed language. It is unfortunate that COM (honestly!) is a powerful platform feature built-in to Windows, but it's stagnated and permanently stuck in the year 1999 now - the lack of maintained documentation also makes it incredibly difficult to grok by newcomers. I'll bet there are more people in Gen Z who speak COBOL than feel comfortable around COM/COM+/DCOM.

Re: Visual Basic for Applications Language Specification [pdf]

#13

Is the language spec for Visual Basic 6 available anywhere?

Years and years ago I wrote a basic VB6 -> JVM compiler. I could never find any spec other than the MSDN documentation, so it was basically trial and error to figure out the grammar. Found a bug or two in the VB6 IDE.

Re: Visual Basic for Applications Language Specification [pdf]

#14

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.

Not open source, but VBScript used to be embeddable in VB6 apps, I think VB.NET might have had something too?

Re: Visual Basic for Applications Language Specification [pdf]

#15

Is the language spec for Visual Basic 6 available anywhere?

I don't think VB6 (or really any prior VB) had a real spec, the language was basically QBASIC stitched on a form editor for VB1 and extended over time to add more stuff and after some point could also be embedded in other programs (hence "Visual Basic for Applications"). AFAIK this spec isn't even for VB6, but for a "VB7" (i.e. VB6 with a bunch of changes) that never really got a standalone version and Microsoft made…

Everything has a spec. What do you mean?

It might not have had a written/formal spec, but Microsoft VB6 compiler itself is the spec in that case. I would assume that by VB6, however, something had been written down internal to MS.

Re: Visual Basic for Applications Language Specification [pdf]

#17

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.

Not open source, but if you are ein Windows, youncnanuse the Windows Script Host via COM: https://learn.microsoft.com/en-us/previous-versions//a74hyyw...

Re: Visual Basic for Applications Language Specification [pdf]

#18

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.

Not open source, but if you are ein Windows, youncnanuse the Windows Script Host via COM: https://learn.microsoft.com/en-us/previous-versions//a74hyyw...

Didn't they recently deprecate this?

https://nolongerset.com/vbscript-deprecation/

Re: Visual Basic for Applications Language Specification [pdf]

#19
post #6

Earlier quoted context omitted.

QuickBasic, not QBasic. They weren't the same, those that only experienced MS-DOS 5.0 QBasic keep mixing them up. QBasic was a stripped down version of QuickBasic. Not sure about you, talking in general.

Strictly speaking i don't think it was QuickBasic either (VB1 for DOS most likely was but IIRC there were minor language differences between the two), but in my message i didn't mean the exact product, just that it used an existing BASIC implementation they had with their take on making BASIC more Pascal-like. QBASIC is by far the most known implementation of that dialect. (i just made a search and found an article a…

Visual Basic clearly seems to have been aiming at QBasic/QuickBasic compatibility, in any case.

For example, the CALL keyword in QBasic is almost useless: It allows you to call procedures without a DECLARE statement, but DECLARE statements are automatically generated on save anyway.

In Visual Basic, even in version 1.0, it's completely useless because DECLARE statements are not required anymore, but both CALL and DECLARE are still in there in the language, presumably for compatibility.

Post reply on HN