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

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
.
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,223,886
Messages
6,175,198
Members
452,616
Latest member
intern444

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