VBA Code to Trigger Macro Event

SRafter

New Member
Joined
Jul 12, 2011
Messages
8
Hi everyone, I have a macro in a large excel workbook that I use to refresh queries imported from MS Access.

Can anyone help with the VBA code I would need to trigger the macro to refresh the queries at a particular time every day?

Look forward to hearing from you. Cheers, Steve.
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
I believe there is an applicaiton.ontime event, you can use that to schedule macros note the sheet with the macros in needs to be open at run time. To get around this in the past I have set up a batch file to open the sheet which then uses auto open macros, I then set the batch file up as a scheduled task in Windows. This way Excel can be open or closed and it will still work.
 
Upvote 0
Thanks Blade, I perhaps should have pointed out that I am very, very new to VBA. My skills extend only to assigning a macro to refresh my imported queries, so I only understood about half of your reply.

Im really looking for a hand to write the code if you or anyone else out there can help.

Cheers, Steve.
 
Upvote 0
Which solution do you want? The scheduled task option or the ontime option?

I prefer the scheduled task. Others prefer the ontime. Your call :).

Cheers

Dan
 
Upvote 0

Forum statistics

Threads
1,224,597
Messages
6,179,812
Members
452,945
Latest member
Bib195

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