+ Reply to Thread
Results 1 to 4 of 4

cant run macro automatically and manual both

  1. #1
    Registered User
    Join Date
    04-30-2010
    Location
    Fairmont,WV
    MS-Off Ver
    Excel 2007
    Posts
    66

    Arrow cant run macro automatically and manual both

    I think this is a really unique problem. I have a worksheet that has a macro setup in it to send emails if a cell's value equals the date that the worksheet is opened. In other words. if I open the worksheet and cell A1's date equals that days date, the macro runs. If the date doesn't match, the macro doesn't run. Simple enough. Here's my problem. I need it to run once a week automatically with out having to open it. Again, simple enough. I did this by creating a scheduled task so it opens on its own and closes on its own also. That the kicker. Since its set up to open, run, and then close ...how do I keep this from running when its opened manually,( to input data, but still run completely when its opened on a scheduled task. If the person opens its manually, the macro runs and it closes. I need it to do this ONLY when its opened on a schedule.
    I sincerely hope this is not as confusing as it sounds.
    Thanks

  2. #2
    Valued Forum Contributor
    Join Date
    10-26-2008
    Location
    Birmingham, UK
    MS-Off Ver
    All versions up to 2010
    Posts
    1,025

    Re: cant run macro automatically and manual both

    Hi
    If I understand you correctly I would create a duplicate (working copy) of your workbook without the macros. Then create links to the data in both workbooks. Then any changes in your working copy will automatically be replicated in the other workbook.
    Hope this helps.
    Good luck.
    Tony

  3. #3
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: cant run macro automatically and manual both

    Test for the time when it is running the macro, if this is at (or close to) the time the scheduler is set to, close the workbook, otherwise leave it open?

  4. #4
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: cant run macro automatically and manual both

    I'd use a different workbook in the scheduled task, which contains code to open your main workbook, run its macro and then close it, and itself. That way your main workbook doesn't need to auto close.
    Remember what the dormouse said
    Feed your head

+ 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] Manual sort macro
    By smpita in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 03-04-2014, 09:27 PM
  2. Replies: 2
    Last Post: 01-24-2013, 07:59 AM
  3. Macro for automating the manual stuff
    By shruthidwh in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-04-2011, 11:16 AM
  4. Excel sets calculation to Manual automatically
    By Otto Moehrbach in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-18-2006, 02:10 PM
  5. Macro with manual file selection?
    By Pmedina in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-23-2005, 05:50 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