Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Scheduled Tasks - How do I schedule a MACRO 7

Status
Not open for further replies.

PSUIVERSON

Technical User
Nov 6, 2002
95
US
to run in SCHEDULED TASKS in WINDOWS XP? I know how to use the WIZARD but cannot figure out how to set this up?

thanks
 
As far as I know, you can only schedule executables.
So if you want to schedule a macro, you must "cheat":

write a small vb exe. In this you need a reference to the app in which the macro shall run. call the app from the exe, open the respective file and use the respective macro-call routine.
After you have compiled your exe, you can schedule the exe which will then run the macro... voilà!

A long and winding road....

Andreas Galambos
EDP / Technical Support Specialist
Bowne Global Solutions Wuppertal, Germany
(andreas.galambos@bowneglobal.de)
HP:
 
Hi!

If you name the macro autoexec then all you need to do is open the database and it will run. Of course, it will run anytime you open the database, unless you press the shift key while opening the db, so if this is a production db then that would not be an optimum solution. If you tell us what you are intending to do we may be able to figure a good way to do it.

hth


Jeff Bridgham
bridgham@purdue.edu
 
I have seen the process run before in which the run line in the properties of the TASK looks something like this

...point at database and then macro

C:\PROGRA~1\MICROS~4\Office\MSACCESS.EXE \\NETWORKDRIVE\FOLDER\accessDB.mdb /x MacroName

* When I attempted to replicate this on my machine I am not having success. I think I will write the VB .exe program if I cannot resolve here shortly.

Thanks...
 
PSUIVERSON is correct. You use the x switch. The only thing I want to add is the syntax for the Run and Start In boxes. This is what the Run box will look like. The first string is the path to the Access.exe file
"C:\PROGRA~1\MICROS~4\Office\MSACCESS.EXE" "\\NETWORKDRIVE\FOLDER\accessDB.mdb"/xMacroName
The second string is the path to your .mdb file with the x switch added.

The Start In box contains the path to the Access.exe file.

HTH

Paul
 
Now that's really interesting. And since I didn't wnat to give only PSUIVERSON a star (for his own thread [lol]), Paul has also deserved his for clearing this issue...

I think I will go right ahead and schedule some macros...
[bigcheeks]

Andreas Galambos
EDP / Technical Support Specialist
Bowne Global Solutions Wuppertal, Germany
(andreas.galambos@bowneglobal.de)
HP:
 
Paul --> I am having problems getting this to run. I keep scheduling it to run and then the status says WOULD NOT START...or something to that effect.

Here is what my steps are:

* I create a new wizard to setup a scheduled task goto PROGRAM FILES and select the ACCESS .exe

"C:\Program Files\Access97\Office\MSACCESS.EXE"

NOTE: Don't ask why we this is in Access 97. Long story. ;)

* This is how it appears in the run line once I save. I attemp to edit this by then adding the path to the DATABASE and the macro command at the end of the line like so:

C:\Program Files\Access97\Office\MSACCESS.EXE \jh159\share$\JEAPPLICATION\jeDatabase.mdb \x MorningProcess

I then put the following in the START IN line

C:\Program Files\Access97\Office

* I continue to get the message "COULD NOT START"

Anthing you notice I am doing wrong?

Thanks...

 
Have you enclosed the command in quotes? Else the space in "Program Files" will cause such an error...

MakeItSo

Andreas Galambos
EDP / Technical Support Specialist
(andreas.galambos@bowneglobal.de)
HP:
 
Alright I fixed the quotes but now when it opens ACCESS it says

"THE COMMAND LINE YOU USED TO START MICROSOFT ACCESS CONTAINS AN OPTION THAT MICROSOFT ACCESS DOES NOT RECOGNIZE"

Exit and restart Access using valid command-line options


* This is my run line

"C:\Program Files\Access97\Office\MSACCESS.EXE" "\\jh159\share$\JEAPPLICATION\jeDatabase.mdb"\x MorningProcess

I think I'm close... ;)

 
Yepp, now you gotta add a space, me think. ;-)
Right there:
jeDatabase.mdb" \x MorningProcess
before the \x...

Cheerio,
MakeItSo

Andreas Galambos
EDP / Technical Support Specialist
(andreas.galambos@bowneglobal.de)
HP:
 
the reference to the macro should be the forward slash with no spaces. like this
"C:\Program Files\Access97\Office\MSACCESS.EXE" "\\jh159\share$\JEAPPLICATION\jeDatabase.mdb" /xMorningProcess
 
No space between the x and macro name and you slash is /, not \ (as in the path).

"C:\Program Files\Access97\Office\MSACCESS.EXE" "\\jh159\share$\JEAPPLICATION\jeDatabase.mdb"/xMorningProcess

Paul

 
Nice! Thanks guys. Much appreciated. All setup...Running as we speak!

 
May be a little late in the day... but the Handy Access Launcher (HAL) is a freeware tool designed specifically for scheduling Access database macro runs, compacts and repairs. You can find it at
Hope this helps.
 
It's never too late for a good hint! ;-)
Looks really good. Thanks mp9.
[thumbsup]
 
Thank you soooo much mp9!!!

I didn't know such a thing existed, but now that I do it will save me a lot of time and headaches.

:)

Gave you a star, you deserve it. And thanks to everyone else in this helpful forum too!

Asmodeus
 
I have been running a batch process through the windows scheduler every morning. I just implemented security on the db so I am switching to HAL

I was wondering if you still have to call the HAL schedule (.hal file) from the windows scheduler or do you just set up the schedule and leave Hal running in the system tray.
 
you just set up the schedule and leave Hal running in the system tray."

That's the answer. ;)

Asmodeus
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top