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!

Command-Line Parameter Not WOrking 1

Status
Not open for further replies.

JPeters

MIS
Jul 25, 2001
423
US
Quick Q for you guys. I've had this problem in the past, and I got it to work then, however I don't remember how.

Trying to make a macro run from command prompt. I'm trying to run a macro that runs a piece of code that exports an excel file, then closes the database Trying to schedule this to run each night at like 4am. So I tried creatin a batch file to be ran through the windows task manager at the set time... and the batch file is basically

\\mynetdrive\dbdir\mydb.dbs /x macroname

I've also tried this with a shortcut.

For some reason this doesn't work.. all this batch file is doing is opening up the database, but it won't run the macro and close. Please help...

Also, is taskmanager the only way to automate stuff like this, because I'd rather ont be logged into the comp at work all night for taskmanager to run, and I don't think taskmanager runs if no one is logged in.

-Josh

------------------
-JPeters
Got a helpful tip for Access Users? Check out and contribute to 'How to Keep Your Databases from becoming Overwhelming!'
thread181-293590
jpeters@guidemail.com
------------------
 
To execute the command-line options, you must specify the absolute path to msaccess at the beginning of the command line. Example:
[tt]
"C:\Program Files\Microsoft Office\Office\Msaccess.exe" \\mynetdrive\dbdir\mydb.dbs /x macroname[/tt]
 
How do I close Access, if I open it using this command line?

Thank you
 
You can specify access to be shut down in the macro that you run. Just make sure that the last line of the macro is Quit and then select the options of Prompt, Save All, or Exit. Save All and Exit will automatically shut down the database without user intervention.

-Josh

------------------
JPeters
------------------
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top