Consulting

Results 1 to 11 of 11

Thread: Create an executable from a macro

  1. #1

    Create an executable from a macro

    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

  2. #2
    VBAX Expert Logit's Avatar
    Joined
    Sep 2016
    Posts
    613
    Location
    .
    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.

  3. #3
    I just read your message.
    Thank you for your answer

  4. #4
    VBAX Guru Kenneth Hobs's Avatar
    Joined
    Nov 2005
    Location
    Tecumseh, OK
    Posts
    4,956
    Location
    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.

  5. #5
    Quote Originally Posted by Kenneth Hobs View Post
    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.

  6. #6
    VBAX Guru Kenneth Hobs's Avatar
    Joined
    Nov 2005
    Location
    Tecumseh, OK
    Posts
    4,956
    Location
    I am lost. You explained .NET (Visual Studios)? If you knew about .NET, then why ask about creating EXE files in #1?

  7. #7
    Quote Originally Posted by Kenneth Hobs View Post
    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.

  8. #8
    VBAX Guru Kenneth Hobs's Avatar
    Joined
    Nov 2005
    Location
    Tecumseh, OK
    Posts
    4,956
    Location
    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.

  9. #9
    Quote Originally Posted by Kenneth Hobs View Post
    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?

  10. #10
    VBAX Guru Kenneth Hobs's Avatar
    Joined
    Nov 2005
    Location
    Tecumseh, OK
    Posts
    4,956
    Location
    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.

  11. #11
    Quote Originally Posted by Kenneth Hobs View Post
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •