Questions about executable program generation in VBA/Excel

Asked

Viewed 2,178 times

3

I compiled a VBA program that interacts with an Excel spreadsheet. After having no more faults pointed out when compiling, the compilation is executed and no action is presented at the end.

I did not find the executable program in any folder (if it was generated).

While researching the subject, I was left with more doubts:

Is it possible to generate the VBA executable program that makes use of Excel spreadsheets? There are indications that in these cases an Excel of compatible version has to be installed in each computer on which it will be executed, precisely for making use of the spreadsheet and need Excel.

If the build generated the executable program, where is the file being saved? There are indications of directory names that I have not located, for example, "BIN".

I would like to know what actually happens and how I should proceed to generate and install the generated program on other computers.

1 answer

5


The VBA, which means Visual Basic for Applications, is an interpreted language created by Microsoft to allow the automation of some processes in its applications (hence the name Visual Basic for Applications). Because it is an interpreted language, there is no executable generation. A specific module, shared by all applications using VBA, is responsible for interpreting the code written in that language, directly from the application that uses it. That is why the VBA has the generic instructions/commands(os) and the specific ones(as) of each application (in Excel, there are classes to manipulate spreadsheets, in Word, to manipulate text styles, in Powerpoint to manipulate shapes and slides, etc).

I don’t know if there are any robust VBA compilers or that work well, but I suspect that if there are will be few. After all, if your idea is to make an executable, you can use any other language (including Visual Basic) to access and/or manipulate Office files via specific libraries. The only use for a compilation of VBA code in executable that I see would be to hinder access to your code, but even so it is possible to protect the projects within the Office tools and achieve this behavior without having to generate anything external.

Anyway, while doing a Google search I found some options like this one Vbacompiler (that seems to generate a DLL from the code). I do not know it, and do not know if it works as expected.

  • 1

    Thanks for the clarification, I’ll check what you indicated.

  • 1

    There are really solutions to protect the code by generating executable (for example, Secure++ VBA For Microsoft Office Excel & Powerpoint), but they need the office to run in the same way. Some comment that in addition to protection there is the performance gain. I was interested in using VB in specific cases, but the doubt is whether VB is a language that has support and updates or is like VBA, which was discontinued (it seems that the latest version of VB is from 2010). What would be other options to replace VB if any, because I read that Delphi was discontinued.

  • 1

    VB was continued through the . NET (as an additional language for building the code). Have a look up.

  • 1

    Okay. I’ll see. Thank you

Browser other questions tagged

You are not signed in. Login or sign up in order to post.