2

I am trying to figure out if the VBA code running in microsoft office is being compiled (to some intermediate language like MSIL) or is it an interpreter based language interpreting the VBA itself.

I tried to find a straight answer on the net and could find anything clear. I tried to find an API that "compiles" the VBA, but I did find any (and that does not mean the code is not being compiled).

Does anyone know what is going on in the internals, or at least an idea on how to check it out?

R3uK
  • 14,417
  • 7
  • 43
  • 77
TCS
  • 5,790
  • 5
  • 54
  • 86

1 Answers1

5

I'm not sure if this is what you're explicitly looking for, but I managed to find this...

"Code written in VBA is compiled to a proprietary intermediate language called P-code (packed code), which the hosting applications (Access, Excel, Word, Outlook, and PowerPoint) store as a separate stream in COM Structured Storage files (e.g., .doc or .xls) independent of the document streams. The intermediate code is then executed[1] by a virtual machine (hosted by the hosting application)."

From the following wiki page..

http://en.wikipedia.org/wiki/Visual_Basic_for_Applications

More info on P-Code..

http://en.wikipedia.org/wiki/Microsoft_P-Code

Hope this helps!

Conquistador
  • 362
  • 2
  • 5
  • 19
  • When I looked on the P-Code wiki page, it did say that P-Code has generally been phased out for CIL (Common Intermediate Language), but it seems to me from the above statement that it is still used within Office. – Conquistador Jul 10 '13 at 08:11