Automatic Data Pull at Certain Times Everyday

mikeHunt

New Member
Joined
Jul 16, 2018
Messages
5
I am having trouble with my vba program that is supposed to pull data from 2 databases and then copy and paste the data into a new workbook. The code itself for the data pull and the copy and paste works fine when I run the modules alone. When I put the modules in the automatic timer they seem to get stuck in an infinite loop until an error pops up and stops the program. I am wondering what is causing this.. and is there a better way to go about automating this program. my code for the timer is as follows .

Sub Timer()
Application.OnTime TimeValue("00:00:00"), "Test"
Application.OnTime TimeValue("00:00:00"), "ISMSM"
Application.OnTime TimeValue("00:00:00"), "CopyData"

'This code repeats for 4 times throughout the day

End Sub
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
.
You could try this macro :

Code:
Option Explicit


Sub RunMacs()


Test
ISMSM
CopyData


    Application.OnTime Now + TimeValue("00:00:05"), "RunMacs" '<-- currently set to run every 5 seconds


End Sub
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,177
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top