PDA

View Full Version : Create an executable from a macro



stefanoste78
09-23-2018, 10:22 AM
Good evening.
I would like to ask you for information. Could you convert a scrapping macro to an executable with visual basic, since the programming language is similar?
If someone answers then I would like to ask other questions combined with this.
Thank you

Logit
09-24-2018, 08:54 AM
.
You would need to convert your macro to VB code to make it an executable.

There are commerical products that claim to make Excel an executable but .... not really. Been down that road before and haven't found a solution
other than to program your project into another language.

stefanoste78
09-25-2018, 10:43 PM
I just read your message.
Thank you for your answer

Kenneth Hobs
09-26-2018, 09:37 AM
If the code is VBS, name the file with a VBS file extension. It will then be "executable" unless your IT has a restriction.

There are methods to autoexecute VBA code when the XLSM opens. That is not exactly "executable" per se. It is an easy way to autoexecute a file via a Windows Schedule Task. I usually put a timer MsgBox() to allow an edit option. If option not selected, it execute the rest of the code and closes the file.

stefanoste78
09-27-2018, 02:20 AM
If the code is VBS, name the file with a VBS file extension. It will then be "executable" unless your IT has a restriction.

There are methods to autoexecute VBA code when the XLSM opens. That is not exactly "executable" per se. It is an easy way to autoexecute a file via a Windows Schedule Task. I usually put a timer MsgBox() to allow an edit option. If option not selected, it execute the rest of the code and closes the file.


I had explained that visual studio contains visual basic and other languages like c ++ ect.
So being that macros use vb you could somehow create an executable.
You probably need to first convert the code of a macro to visual basic and then create the program with visual studio.

Kenneth Hobs
09-27-2018, 07:09 AM
I am lost. You explained .NET (Visual Studios)? If you knew about .NET, then why ask about creating EXE files in #1?

stefanoste78
09-27-2018, 11:50 PM
I am lost. You explained .NET (Visual Studios)? If you knew about .NET, then why ask about creating EXE files in #1?


I'm trying to understand the differences between visual basic, vb.net and visual studio to understand which language is most useful to try to create a program starting from a code that I have done with the Excel code.

Kenneth Hobs
09-28-2018, 05:17 AM
Vb.net is in visual studios. Going to vb or vbs or vb.net from vba is not too difficult. It just depends on the code. E.g vbs does not use early bound references. Ergo, no intellisense.

stefanoste78
09-28-2018, 06:03 AM
Vb.net is in visual studios. Going to vb or vbs or vb.net from vba is not too difficult. It just depends on the code. E.g vbs does not use early bound references. Ergo, no intellisense.


Do you also know these other languages?

Kenneth Hobs
09-28-2018, 04:10 PM
I have used them, and others. These days, I mostly do VBA.

I am not sure how many forums would help translating one language to another. If small, you could post the code and ask. The vb.net forums would probably be your best bet.

stefanoste78
09-29-2018, 12:04 AM
I have used them, and others. These days, I mostly do VBA.

I am not sure how many forums would help translating one language to another. If small, you could post the code and ask. The vb.net forums would probably be your best bet.

thank you, Mr. Hobson. I have to try to improve the macro that I have already and then write in the forum that you indicated to me.