+ Reply to Thread
Results 1 to 3 of 3

Auto open a workbook and run specified macro after logging on (Advanced VBA question)

  1. #1
    Valued Forum Contributor
    Join Date
    08-29-2012
    Location
    In lockdown
    MS-Off Ver
    Excel 2010 (2003 to 2016 but 2010 for choice)
    Posts
    1,766

    Auto open a workbook and run specified macro after logging on (Advanced VBA question)

    I am tinkering with a hobby project in Excel that I would like to open and run a macro in after I log onto Windows.

    So I am thinking along the lines of a bat file. The bat file would contain a hard-coded path to the XSLM. The desired outcome is that it would cause the XLM to open and run a macro.
    1. Is this doable? If yes, what should the bat file contain and where should it be placed to auto-run? (I would be using Windows XP as the OS)
    2. If a bat isn't technically possible, would there be some other means to achieve this end? IDK, vbscript maybe?
    3. I assume that it may not be possible to specify a specific macro in the XLM to run? If not, I could call the macro from the workbook_open event.
    *******************************************************

    HELP WANTED! (Links to Forum threads)
    Trying to create reusable code for Custom Events at Workbook (not Application) level

    *******************************************************

  2. #2
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,469

    Re: Auto open a workbook and run specified macro after logging on (Advanced VBA question)

    .
    Start program when WINDOWS starts :

    https://support.microsoft.com/en-us/...e-startup-apps


    Open a specific Excel file once Excel is running :

    https://trumpexcel.com/automatically...-file-startup/

    In the above webpage, scroll down the page some until you reach the required section.


    Then .... in the workbook you want auto-opened ... in the ThisWorkbook_Open include a call to the macro you want run.

  3. #3
    Valued Forum Contributor
    Join Date
    08-29-2012
    Location
    In lockdown
    MS-Off Ver
    Excel 2010 (2003 to 2016 but 2010 for choice)
    Posts
    1,766

    Re: Auto open a workbook and run specified macro after logging on (Advanced VBA question)

    Thanks for the tip on XLSTART. I hadn't considered that Excel might have a built-in feature for opening a specified workbook upon open.

    I'm afraid the start program suggestion won't work on Windows XP though.
    Last edited by mc84excel; 10-21-2019 at 04:35 PM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Run a macro auto when i open workbook but one time in whole day
    By HaroonSid in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 04-26-2014, 03:15 AM
  2. Replies: 0
    Last Post: 01-07-2013, 01:22 PM
  3. [SOLVED] Advanced filtering within a workbook question using vba
    By lilsnoop in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-18-2012, 11:26 AM
  4. Replies: 2
    Last Post: 08-03-2012, 05:28 PM
  5. Auto-open macro closes workbook - how do I access its contents?
    By audax in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-12-2009, 02:13 PM
  6. auto run macro when open workbook
    By kaffal in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-15-2009, 02:58 AM
  7. How: open a workbook with auto macro disabled using code?
    By mike_cutting-edge in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-13-2005, 03:06 PM

Tags for this Thread

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