1

I've read that VB6 used the msvbvm60.dll runtime library [1], and also that VBA and VB6 use the same runtime [2].

However I also remember reading that the current version of VBA in Office is VBA7, and if I look in the object browser I find

C:\Program Files\Common Files\microsoft shared\VBA\VBA7.1\VBE7.DLL

Checking what's exported by both files in dependency walker, I can see VBE7.DLL contains a small subset of the functions that msvbvm60.dll exports (e.g both define VarPtr)

enter image description here

but also some new ones (such as rtI8FromErrVar - presumably to help with 64 bit stuff since that's what VBA7 introduced) enter image description here

Clearly some overlaps then, and some new stuff. But looking at the files like this, VBE7 lacks the majority of the content. So does VBA fall back to the common VB6 runtime shipped with Windows?

C:\Windows\SysWOW64\msvbvm60.dll

I ask because I'm trying to access a function exported by msvbvm60.dll, not VBE7.DLL, and I don't know where to find it on Mac

Greedo
  • 4,967
  • 2
  • 30
  • 78
  • The VBA runtime is in both files. Office uses its own copy. Object Browser tells you the file functions are in. VBA is a language that is hosted by other programs including VB. The main difference between Office and VB is they contain different forms packages and have a really different Application object. –  Jul 21 '20 at 20:52
  • So vbe7 is standalone - or at least doesn't have msvbvm as a dependency. Or does office have it's own copy of msvbvm somewhere (I can't find another one) or inside itself? I also can't find a version of either dll for solidworks, which is also a VBA host but not an office product – Greedo Jul 22 '20 at 13:29
  • @Mark basically, without wishing to actually do it since I don't usually mess with stuff that's part of C:/Windows, what would break if I deleted the msvbvm60.dll under Windows? Any of the VBA hosts? – Greedo Jul 22 '20 at 13:31
  • All VB6 compiled programs would stop working. –  Jul 22 '20 at 19:55
  • VBA exists at Microsoft as source code. You can use their's OR write your own implementation (standard here - https://msdn.microsoft.com/en-us/library/dd361851.aspx). You have to pay them money for either approach. They will compile it into different products. –  Jul 22 '20 at 20:33
  • What msvbvm60 function are you trying to access ? – StayOnTarget Jul 22 '20 at 20:36
  • You also cannot call 32 bit functions from a 64 bit VBA. –  Jul 22 '20 at 20:52
  • @UuDdLrLrSs `GetMem8`, like here http://www.xbeat.net/vbspeed/i_VBVM6Lib.html. Ultimately it's because I want to call it on a Mac, and since it's part of the VBA runtime I assume I can somehowe... but in the meantime, I'm interested to know how Microsoft's implementation of the VBA language spec is stored on a computer, if that makes sense – Greedo Jul 22 '20 at 20:57
  • @Greedo Man I'd also love to access these functions, opening VBE7.dll with a text editor I can see the functions are in there! They just aren't exposed publically... Incredibly frustrating. However, regardless, it's highly unlikely you'll be able to use these on Mac as the implementation is very different for Macs. Mac implements objects as ObjectiveC objects for instance. You'll have to rely on the ObjC runtime instead :) see [this](https://github.com/sancarn/VBA-STD-Library/issues/2#issuecomment-674594697) – Sancarn Oct 07 '20 at 09:53
  • @Sancarn Haven't done more than a cursory glance, but [this](https://www.vbforums.com/showthread.php?886355-CAan-anybody-explain-to-me-what-this-uncommented-code-does) seems to be calling functions by offset in the dll not name, maybe it could be a workaround? That's my very rudimentary understanding, I don't really know much about dlls (how did you read the dll exactly?) Thanks for the link on Mac stuff, very interesting read – Greedo Oct 20 '20 at 11:36

0 Answers0