Running macro as a Scheduled Task

E

E Harris

Hello all.

I want to schedule an Access macro to run. The macro runs 3
make-table queries.

The best way I thought to accomplish this is to create a shortcut, and
then use the task scheduler to run that shortcut.

I am working within a secure workgroup. Here is what my shortcut
contains:

"C:\Program Files\Microsoft Office\Office10\MSACCESS.EXE"
"C:\PathToDatabase\database.mdb" /user "myUsername" /pwd "myPassword"
/x "MakeListboxTables"

Manually running this shortcut works fine, except for one thing--
since make-table queries are what the macro runs, a total of 6 dialog
boxes pop up, 2 for each make-table query. The first asks me to
confirm that I want to run a make-table query. Once the query runs, a
second dialog box ask me to confirm that I want to insert X rows of
data into the new table.

Of course, sitting at my computer, I can click "Yes" 6 times and
accomplish the task. My question is.... how can I skip the dialog
boxes so that I can automate this task with the task scheduler? Is
there another /switch I can use on the command-line (that is, my
shortcut) that will bypass these dialog boxes?

I'm so close to making this work! Please, any help is greatly
appreciated.

Thanks so much!
 
L

Lynn Trapp

Set the First line of your macro to be SetWarnings = No and the Last line to
be SetWarnings = Yes.
 
S

Steve Schapel

E Harris,

Put a SetWarnings,No action in your macro, prior to your first RunSQL or
OpenQuery action.
 
G

Guest

Or, I use the sendkeys option to "send" keystrokes.
ie: {enter}{tab}{enter}{enter}
This command "sends" these keystrokes for you.
Works like a charm!
 
S

Steve Schapel

Anonymous,

I am pleased to know that this works for you. However, with all due
respect, I should point out that many people regard SendKeys as a
non-robust approach, with several significant disadvanteges, and
alternatives should be used wherever possible.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top