+ Reply to Thread
Results 1 to 3 of 3

option to not run macro on startup with timer

  1. #1
    Registered User
    Join Date
    10-17-2012
    Location
    Sydney
    MS-Off Ver
    Excel 2010
    Posts
    2

    option to not run macro on startup with timer

    Hello,

    I have a macro that runs when a spreadsheet is opened however i sometimes need it not to run. Rather then furiously hit escape i was hoping to get a dialog box that would prompt yes/no to run the macro and if an option was not chosen after a few second then to run the macro anyway (so basically only by clicking "no" would you stop the macro from running).

    I found this code here that gives me the yes/no message box and the 5 second time-out to get rid of the message box, however if the message times out it doesn't run the macro. Any ideas what i need to tweak to make it do so if no input comes from the user?
    http://www.excelforum.com/excel-prog...s-reached.html


    Thank you!

  2. #2
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,198

    Re: option to not run macro on startup with timer

    Hi, one_inch,

    adjust the code for the Workbook_Open event in ThisWorkbook accordingly:
    Please Login or Register  to view this content.
    Ciao,
    Holger
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

  3. #3
    Registered User
    Join Date
    10-17-2012
    Location
    Sydney
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: option to not run macro on startup with timer

    Hi Holger,

    Thanks for your reply, it didn't quite work as excel wouldn't sat on the splash screen while it waited for the uer input, but wouldn't time out the message box as it had not finished loading the program (i think, it was just in limbo). I managed to put an application.ontime command into the workbook open code to get it to wait a few seconds while excel loaded properly and then called your code as a seperate macro and it worked a treat.

    Thanks again

+ 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. Replies: 1
    Last Post: 12-12-2012, 08:46 PM
  2. [SOLVED] Stopping a Timer / Running a timer simultaneously on Excel
    By Paul23 in forum Excel General
    Replies: 1
    Last Post: 03-10-2006, 08:10 AM
  3. [SOLVED] Startup option
    By MS Excel in forum Excel General
    Replies: 10
    Last Post: 10-10-2005, 11:05 AM
  4. [SOLVED] Excel startup option
    By GeraldM in forum Excel General
    Replies: 2
    Last Post: 07-26-2005, 09:05 AM
  5. Startup macro
    By Zeno in forum Excel General
    Replies: 1
    Last Post: 06-29-2005, 09:05 AM

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