Closed Thread
Results 1 to 8 of 8

Creating a .EXE to run excel macros

  1. #1
    Hemanth
    Guest

    Creating a .EXE to run excel macros

    Hello,

    I want create a self executing .exe file that opens an userform (or
    dialogbox) with a Run button along with some other controls and runs a
    VBA macro when user clicks on the button.

    Can someone suggest me an easiest and quick way to do this? Also, can
    it be done without using Visual Studio for VB (I only have access to MS
    Excel with VBA support)?

    Your help is much appreciated.

    TIA,
    Hemanth


  2. #2
    NickHK
    Guest

    Re: Creating a .EXE to run excel macros

    Hemanth,
    If you only have Excel, then creating an .exe is not possible.

    By changing the appearance of Excel and/workbook, you can disguise Excel's
    appearance.

    What are you trying to achieve ?

    NickHK

    "Hemanth" <[email protected]> wrote in message
    news:[email protected]...
    > Hello,
    >
    > I want create a self executing .exe file that opens an userform (or
    > dialogbox) with a Run button along with some other controls and runs a
    > VBA macro when user clicks on the button.
    >
    > Can someone suggest me an easiest and quick way to do this? Also, can
    > it be done without using Visual Studio for VB (I only have access to MS
    > Excel with VBA support)?
    >
    > Your help is much appreciated.
    >
    > TIA,
    > Hemanth
    >




  3. #3
    cush
    Guest

    RE: Creating a .EXE to run excel macros

    Without VB or an equivalent, you cannot make an .exe

    What you can do is something like the following:

    Hide all sheets except one, say, Sheet1.

    Format Sheet1: no gridlines, no Tabs, no Headers, just white space

    Open the Visual Basic Editor (Alt+F11)
    In the ThisWorkbook module copy and paste the following:

    Option Explicit
    Sub Workbook_Open()
    MyUserForm.Show
    End Sub

    This assumes that you already have a userform that you have
    named: MyUserForm
    which has one or more command buttons.
    The command button(s) will have macros that are fired on their _Click events
    Likely in the first click-event you will unhide any sheets needed by the
    user to
    continue, plus hide Sheet1.
    Sheet1 should remain empty.

    "Hemanth" wrote:

    > Hello,
    >
    > I want create a self executing .exe file that opens an userform (or
    > dialogbox) with a Run button along with some other controls and runs a
    > VBA macro when user clicks on the button.
    >
    > Can someone suggest me an easiest and quick way to do this? Also, can
    > it be done without using Visual Studio for VB (I only have access to MS
    > Excel with VBA support)?
    >
    > Your help is much appreciated.
    >
    > TIA,
    > Hemanth
    >
    >


  4. #4
    John Coleman
    Guest

    Re: Creating a .EXE to run excel macros


    Hemanth wrote:
    > Hello,
    >
    > I want create a self executing .exe file that opens an userform (or
    > dialogbox) with a Run button along with some other controls and runs a
    > VBA macro when user clicks on the button.
    >
    > Can someone suggest me an easiest and quick way to do this? Also, can
    > it be done without using Visual Studio for VB (I only have access to MS
    > Excel with VBA support)?
    >
    > Your help is much appreciated.
    >
    > TIA,
    > Hemanth


    You can't use VBA to make stand-alone executables. You can use a
    workbook open event that automatically shows the userform when the
    workbook is open and create an icon linked to the workbook.
    Functionally, this will have much of the same effect as what you are
    asking for. You can also launch a VBA macro from VBScript (though you
    need to create an instance of excel to do so, if a VBScript icon looks
    better to you than an excel icon. If you want to get fancy, you can get
    the script to run in a .hta file (an html application) and use the
    browser to display the form and call the macro. I don't know how to do
    this as I haven't yet had the opportunity to learn html applications,
    but I know it can be done.

    Just some ideas

    -John Coleman


  5. #5
    Hemanth
    Guest

    Re: Creating a .EXE to run excel macros

    I think open workbook event with a userform should work fine for my
    case. If not .exe, I'm looking for a way to emulate the same.

    Thank you all for your suggestions.

    - Hemanth



    John Coleman wrote:
    > Hemanth wrote:
    > > Hello,
    > >
    > > I want create a self executing .exe file that opens an userform (or
    > > dialogbox) with a Run button along with some other controls and runs a
    > > VBA macro when user clicks on the button.
    > >
    > > Can someone suggest me an easiest and quick way to do this? Also, can
    > > it be done without using Visual Studio for VB (I only have access to MS
    > > Excel with VBA support)?
    > >
    > > Your help is much appreciated.
    > >
    > > TIA,
    > > Hemanth

    >
    > You can't use VBA to make stand-alone executables. You can use a
    > workbook open event that automatically shows the userform when the
    > workbook is open and create an icon linked to the workbook.
    > Functionally, this will have much of the same effect as what you are
    > asking for. You can also launch a VBA macro from VBScript (though you
    > need to create an instance of excel to do so, if a VBScript icon looks
    > better to you than an excel icon. If you want to get fancy, you can get
    > the script to run in a .hta file (an html application) and use the
    > browser to display the form and call the macro. I don't know how to do
    > this as I haven't yet had the opportunity to learn html applications,
    > but I know it can be done.
    >
    > Just some ideas
    >
    > -John Coleman



  6. #6
    JhonDo
    Guest

    Re: Creating a .EXE to run excel macros


    Hi!
    >> If you only have Excel, then creating an .exe is not possible.


    Have a look at this DoneEx XCell Compiler.
    www.DoneEx.com'www.doneex.com' (http://www.doneex.com)
    This one and Excel is what you need to do exe from xls.

    Regards.


    --
    JhonDoPosted from - http://www.officehelp.in


  7. #7
    Registered User
    Join Date
    07-08-2011
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    1

    Arrow Re: Creating a .EXE to run excel macros

    Quote Originally Posted by Hemanth View Post
    Hello,

    I want create a self executing .exe file that opens an userform (or
    dialogbox) with a Run button along with some other controls and runs a
    VBA macro when user clicks on the button.

    Can someone suggest me an easiest and quick way to do this? Also, can
    it be done without using Visual Studio for VB (I only have access to MS
    Excel with VBA support)?

    Your help is much appreciated.

    TIA,
    Hemanth
    HI,

    I have solution for this instead of creating exe file.You can do like this

    copy the below code to notepad and save it as filename.vbs....

    Dim xlApp
    Set xlApp = CreateObject("Excel.Application")
    xlApp.Workbooks.Open "D:\temp\vbs\tempdel.xlsm"
    xlApp.Ontime Now,"tempdel.xlsm!start"
    Set xlApp = Nothing

    In this replace start with your userforn name
    and path with excel macro sheet path

  8. #8
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Creating a .EXE to run excel macros

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing. Highlight your code and click the # at the top of your post window. For more information about these and other tags, found hereAs this Thread is 5 years old, I doubt if the OP is still waiting around for an answer
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

Closed Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1