+ Reply to Thread
Results 1 to 5 of 5

Start Excel Macro upon opening of document

  1. #1
    Brett
    Guest

    Start Excel Macro upon opening of document

    This is likely quite a simple question, but I have not been able to find this
    in the online help of Excel or on the boards.

    I have built a nice little Excel app to display some real time data. The
    macro works wonderfully and I am very statisfied with it.

    What I need to do is lauch that particular macro whenever this document is
    opened. I am trying to make this as easy as possible for my end user, and
    this would surely do it.

    TIA!

  2. #2
    Gary Keramidas
    Guest

    Re: Start Excel Macro upon opening of document

    Open Event
    See AlsoApplies ToExampleSpecifics
    Occurs when the workbook is opened.
    Private Sub Workbook_Open()
    Example
    This example maximizes Microsoft Excel whenever the workbook is opened.
    Private Sub Workbook_Open()
    Application.WindowState = xlMaximized
    End Sub


    --


    Gary


    "Brett" <[email protected]> wrote in message
    news:[email protected]...
    > This is likely quite a simple question, but I have not been able to find
    > this
    > in the online help of Excel or on the boards.
    >
    > I have built a nice little Excel app to display some real time data. The
    > macro works wonderfully and I am very statisfied with it.
    >
    > What I need to do is lauch that particular macro whenever this document is
    > opened. I am trying to make this as easy as possible for my end user, and
    > this would surely do it.
    >
    > TIA!




  3. #3
    Brett
    Guest

    Re: Start Excel Macro upon opening of document

    Thanks, but forgive my ignorance on this stuff....

    Where do I put this code? In the same module as my other code? For
    arguement, lets call my macro I want to start "EZMAC". Should the full code
    look like this:

    Open Event
    Private Sub Workbook_Open()
    EZMAC
    End Sub

    Is there a special place to put these modules?

    Thanks again.


    "Gary Keramidas" wrote:

    > Open Event
    > See AlsoApplies ToExampleSpecifics
    > Occurs when the workbook is opened.
    > Private Sub Workbook_Open()
    > Example
    > This example maximizes Microsoft Excel whenever the workbook is opened.
    > Private Sub Workbook_Open()
    > Application.WindowState = xlMaximized
    > End Sub
    >
    >
    > --
    >
    >
    > Gary
    >
    >
    > "Brett" <[email protected]> wrote in message
    > news:[email protected]...
    > > This is likely quite a simple question, but I have not been able to find
    > > this
    > > in the online help of Excel or on the boards.
    > >
    > > I have built a nice little Excel app to display some real time data. The
    > > macro works wonderfully and I am very statisfied with it.
    > >
    > > What I need to do is lauch that particular macro whenever this document is
    > > opened. I am trying to make this as easy as possible for my end user, and
    > > this would surely do it.
    > >
    > > TIA!

    >
    >
    >


  4. #4
    Gary Keramidas
    Guest

    Re: Start Excel Macro upon opening of document

    just put your code in between this

    Sub auto_open()

    code here

    End Sub

    --


    Gary


    "Brett" <[email protected]> wrote in message
    news:[email protected]...
    > Thanks, but forgive my ignorance on this stuff....
    >
    > Where do I put this code? In the same module as my other code? For
    > arguement, lets call my macro I want to start "EZMAC". Should the full
    > code
    > look like this:
    >
    > Open Event
    > Private Sub Workbook_Open()
    > EZMAC
    > End Sub
    >
    > Is there a special place to put these modules?
    >
    > Thanks again.
    >
    >
    > "Gary Keramidas" wrote:
    >
    >> Open Event
    >> See AlsoApplies ToExampleSpecifics
    >> Occurs when the workbook is opened.
    >> Private Sub Workbook_Open()
    >> Example
    >> This example maximizes Microsoft Excel whenever the workbook is opened.
    >> Private Sub Workbook_Open()
    >> Application.WindowState = xlMaximized
    >> End Sub
    >>
    >>
    >> --
    >>
    >>
    >> Gary
    >>
    >>
    >> "Brett" <[email protected]> wrote in message
    >> news:[email protected]...
    >> > This is likely quite a simple question, but I have not been able to
    >> > find
    >> > this
    >> > in the online help of Excel or on the boards.
    >> >
    >> > I have built a nice little Excel app to display some real time data.
    >> > The
    >> > macro works wonderfully and I am very statisfied with it.
    >> >
    >> > What I need to do is lauch that particular macro whenever this document
    >> > is
    >> > opened. I am trying to make this as easy as possible for my end user,
    >> > and
    >> > this would surely do it.
    >> >
    >> > TIA!

    >>
    >>
    >>




  5. #5
    Chip Pearson
    Guest

    Re: Start Excel Macro upon opening of document

    The code should go in the ThisWorkbook code module.


    --
    Cordially,
    Chip Pearson
    Microsoft MVP - Excel
    Pearson Software Consulting, LLC
    www.cpearson.com


    "Brett" <[email protected]> wrote in message
    news:[email protected]...
    > Thanks, but forgive my ignorance on this stuff....
    >
    > Where do I put this code? In the same module as my other code?
    > For
    > arguement, lets call my macro I want to start "EZMAC". Should
    > the full code
    > look like this:
    >
    > Open Event
    > Private Sub Workbook_Open()
    > EZMAC
    > End Sub
    >
    > Is there a special place to put these modules?
    >
    > Thanks again.
    >
    >
    > "Gary Keramidas" wrote:
    >
    >> Open Event
    >> See AlsoApplies ToExampleSpecifics
    >> Occurs when the workbook is opened.
    >> Private Sub Workbook_Open()
    >> Example
    >> This example maximizes Microsoft Excel whenever the workbook
    >> is opened.
    >> Private Sub Workbook_Open()
    >> Application.WindowState = xlMaximized
    >> End Sub
    >>
    >>
    >> --
    >>
    >>
    >> Gary
    >>
    >>
    >> "Brett" <[email protected]> wrote in message
    >> news:[email protected]...
    >> > This is likely quite a simple question, but I have not been
    >> > able to find
    >> > this
    >> > in the online help of Excel or on the boards.
    >> >
    >> > I have built a nice little Excel app to display some real
    >> > time data. The
    >> > macro works wonderfully and I am very statisfied with it.
    >> >
    >> > What I need to do is lauch that particular macro whenever
    >> > this document is
    >> > opened. I am trying to make this as easy as possible for my
    >> > end user, and
    >> > this would surely do it.
    >> >
    >> > TIA!

    >>
    >>
    >>




+ Reply to 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