Live data from Hacker News

Visual Basic for Applications Language Specification [pdf]

msopenspecs.azureedge.net

21–30 of 40 posts

Re: Visual Basic for Applications Language Specification [pdf]

#21

Is the language spec for Visual Basic 6 available anywhere?

Although not "official" by MS, perhaps the one from ANTLR's collection [0] is a good start (there are also other ANTLR VB6 grammars documented elsewhere). It does require knowing ANTLR's meta syntax, but it's not that far from (E)BNF.

[0] https://github.com/antlr/grammars-v4/tree/master/vb6

Re: Visual Basic for Applications Language Specification [pdf]

#22

Earlier quoted context omitted.

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 require…

COM has become iunknown ;)

Re: Visual Basic for Applications Language Specification [pdf]

#23

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?

Yes, you can host .NET runtime into another application.

https://learn.microsoft.com/en-us/dotnet/core/tutorials/netc...

Re: Visual Basic for Applications Language Specification [pdf]

#24

Earlier quoted context omitted.

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 require…

COM is the main Windows API since Windows Longhorn .NET ideas were reintroduced as COM libraries in Windows Vista.

Yes, the tooling is still clunky, regardless it being the main way to expose Windows APIs nowadays.

Re: Visual Basic for Applications Language Specification [pdf]

#25

Earlier quoted context omitted.

> 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 require…

COM has become iunknown ;)

And later extended with IInspectable.

Re: Visual Basic for Applications Language Specification [pdf]

#26

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...

VBScript and VBA are unfortunately different languages in practice, at least when it comes to standard library.

Re: Visual Basic for Applications Language Specification [pdf]

#28

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…

I 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).

Re: Visual Basic for Applications Language Specification [pdf]

#29

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…

and IIRC, datatype conversion made through excel formatting options. change cell display to get decimal :) fun

Re: Visual Basic for Applications Language Specification [pdf]

#30

Earlier quoted context omitted.

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…

and IIRC, datatype conversion made through excel formatting options. change cell display to get decimal :) fun

I'm pretty sure that modifying a cell's number format never affects the underlying value.
Post reply on HN