+ Reply to Thread
Results 1 to 4 of 4

Automatically Launch Macro on Open Once Only

  1. #1
    Registered User
    Join Date
    10-23-2007
    Posts
    3

    Automatically Launch Macro on Open Once Only

    Hi guys,

    Does anyone know of a way to automatically run a macro on open once only? i.e. A user opens an excel worksheet, a macro is run prompting them for some information, they save the file, re-open it however this time it does not prompt for the questions? Please see below for my macro. Any help would be greatly appreciated.

    Please Login or Register  to view this content.
    Last edited by VBA Noob; 10-24-2007 at 03:32 AM.

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,525
    Please Login or Register  to view this content.
    This will call the your macro "Project"
    The code Workbook_Open goes into the workbook module

    here it is explained

    http://www.contextures.com/xlvba01.html
    Last edited by davesexcel; 10-24-2007 at 05:27 AM.

  3. #3
    Registered User
    Join Date
    10-23-2007
    Posts
    3
    Thanks for the reply Dave however every time I open the file, it will re-run the macro. I only want it to run once the first time the user opens the file and as soon as they save the document, the prompts will not occur. I think there will have to be a counter or something in the macro to say if counter is greater than 1 do not run.

  4. #4
    Registered User
    Join Date
    10-23-2007
    Posts
    3
    I've written a work around to resolve my issue. Basically just an If statement to say if the cell is Null, prompt with questions. Thanks for your help though Dave. Much appreciated.

    Cheers

+ 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