+ Reply to Thread
Results 1 to 6 of 6

VBA - Staggering Macros and automation during buisness hours

  1. #1
    Registered User
    Join Date
    09-08-2014
    Location
    Detroit, MI
    MS-Off Ver
    2010
    Posts
    55

    VBA - Staggering Macros and automation during buisness hours

    Hello, I am fairly new to VBA and I am having trouble creating a code to do what I am looking to have done. First I will Explain then ill post the code as I have it.

    I need to go to our company page, login, then pull data from reports generated from the company web sites. Then I will need to logout. I will need this macro to repeat itself every hour on the half hour during business hours.

    Also the pulling of data from reports will have to be slightly staggered in order to not crash excel.

    As of now I am able to log in and pull the data, I am just having problems automating this whole thing to run every hour and also to stagger the reports as to not overload excel.

    Please help me get going in the right direction. THANKS!

    Please Login or Register  to view this content.
    Last edited by Johnnyv015; 09-11-2014 at 03:44 PM.

  2. #2
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    16,040

    Re: VBA - Need help on this code.

    Your post does not comply with Rule 1 of our Forum RULES. Your post title should accurately and concisely describe your problem, not your anticipated solution.

    Use terms appropriate to a Google search. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will be addressed according to the OP's experience in the forum: If you have less than 10 posts, expect (and respond to) a request to change your thread title. If you have 10 or more posts, expect your post to be locked, so you can start a new thread with an appropriate title.

    To change a Title go to your first post, click EDIT then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.

    (This thread should receive no further responses until this moderation request is fulfilled, as per Forum Rule 7)
    Never use Merged Cells in Excel

  3. #3
    Registered User
    Join Date
    09-08-2014
    Location
    Detroit, MI
    MS-Off Ver
    2010
    Posts
    55

    Re: VBA - Staggering Macros and automation during buisness hours

    So, as of now. I'm figuring that the best way to automate this to only run during business hours is going to be a start and stop button.

    But I have no idea how to stagger the reports and logout to wait for the previous report to complete, also to run every hour. I'm sure this can be done. its just above my current skill set.

  4. #4
    Registered User
    Join Date
    09-08-2014
    Location
    Detroit, MI
    MS-Off Ver
    2010
    Posts
    55

    Re: VBA - Staggering Macros and automation during buisness hours

    Anyone have any ideas on how I can automate this to run every hour and stagger the macros by a few minutes or seconds? Thanks!

  5. #5
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: VBA - Staggering Macros and automation during buisness hours

    Use the ontime function.

    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    11-13-2006
    Posts
    87

    Re: VBA - Staggering Macros and automation during buisness hours

    In the first macro the runs, check the time and set OnTIme to either run in one hour or the next day and set the next macros OnTime to run in 2 minutes (or whatever,

    In the rest of the macros, set the OnTIme for the Macro that run next. The last Macro doesn't set anything.

    You can also use Wiindows Scheduler (Task Manager) to run the first macro

+ 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] VBA code to save current worksheet as temporary PDF file and then add to my existing code
    By brianfromla in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-20-2014, 08:35 AM
  2. [SOLVED] VBA code for assigning a numeric code to text; then numeric code populates table
    By cteaster in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-14-2014, 08:01 PM
  3. [SOLVED] Excel Macro Visual Basic code not looking at all sheets with second section of code.
    By Heinrich Venter in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-10-2014, 08:26 AM
  4. Replies: 2
    Last Post: 03-09-2013, 04:30 AM
  5. Adding Text to another cell VB code (Help Tweeking code) (Excel 2007)
    By Excelnoub in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-06-2012, 11:37 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