+ Reply to Thread
Results 1 to 6 of 6

Automatically Run Excel Macros Upon Opening Excel Workbook

  1. #1
    Forum Contributor
    Join Date
    09-02-2010
    Location
    singapore
    MS-Off Ver
    Excel 2010
    Posts
    283

    Automatically Run Excel Macros Upon Opening Excel Workbook

    Hi All,

    Need your help badly.

    I trying to run a macro automatically every time I open the excel workbook file using below code. But it seem not working.

    I also try using "Run "Duedate_alert", Call Duedate_alert & etc but it still dont work.

    Hope someone can help on this.

    Please Login or Register  to view this content.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    12-10-2006
    Location
    Sydney
    MS-Off Ver
    Office 365
    Posts
    3,527

    Re: Automatically Run Excel Macros Upon Opening Excel Workbook

    Hi cyee,

    Try this code in Module3:

    Please Login or Register  to view this content.
    Regards,

    Robert
    ____________________________________________
    Please ensure you mark your thread as Solved once it is. Click here to see how
    If this post helps, please don't forget to say thanks by clicking the star icon in the bottom left-hand corner of my post

  3. #3
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,169

    Re: Automatically Run Excel Macros Upon Opening Excel Workbook

    Hi cyee,

    I think you have your code behind a module instead behind the WorkBook.

    http://www.excel-vba-easy.com/vba-pr...excel-vba.html explains it the easy way.
    See http://www.cpearson.com/excel/Events.aspx for an in-deph explaination. Look down to "Application Events" in this link.

    Or see the picture and explaination on http://msdn.microsoft.com/en-us/libr...ffice.12).aspx
    to see that the WorkBook_Open event is in the code behind ThisWorkbook.
    Last edited by MarvinP; 06-29-2011 at 11:25 PM.
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  4. #4
    Forum Contributor
    Join Date
    09-02-2010
    Location
    singapore
    MS-Off Ver
    Excel 2010
    Posts
    283

    Re: Automatically Run Excel Macros Upon Opening Excel Workbook

    Dear Robert,

    Yes!!! U got it!!!
    Thanksssssssss you very much.

    Best Regards.

  5. #5
    Forum Expert
    Join Date
    12-10-2006
    Location
    Sydney
    MS-Off Ver
    Office 365
    Posts
    3,527

    Re: Automatically Run Excel Macros Upon Opening Excel Workbook

    You're welcome. Please don't forget to mark this thread as solved!!

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

    Re: Automatically Run Excel Macros Upon Opening Excel Workbook

    Auto_Open has long been replaced by the WorkBook_Open event
    Hope that helps.

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

    Free DataBaseForm example

+ 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