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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Writing batch file-Execute macro-getting error

Status
Not open for further replies.

Blake290

MIS
Apr 3, 2003
17
0
0
US
I've written a macro to export information to a spreadsheet and then to quit Access. I've also written a batch file to execute a shortcut to launch the macro. The batch file is as follows: d:\datar\studt\storoh.mam

The batch file launches the macro fine and the macro closes the Acess window fine, but at that point an error message pops up on screen:

Cannot find the file 'd:\datar\studt\storoh.man' (or one of its components), Make sure the path and filename are correct qand that all required libraries are available

It is as if the batch file did not expect the macro to close the application. Is there a switch or command that I need to put in the batch file or in the macro to have the macro close and the batch file quit gracefully?
 
I not clear where you are starting your actions from.

From within Excel you can start an Access file, have a macro named autoexec run a set of instructions to update an Excel file, the same macro then closes Access on completion, and drops the user back to Excel.

Is this what you are trying to do?

Telephoto
 
Thanks for responding to my query.

The macro is within Access. It has an "Output To" and "Quit" action. The Output To action puts the information into an Excel spreadsheet on my server.

The batch file is lauched from Windows scheduler on the server. Everything is local to the server.

I need it to be automated so that it closes all windows on the server. When I come in every morning I get the error on screen. This is a bummer.
 
Blake,
If you run the Batch file manually, (double-clicking) does it work properly?

When running from scheduler are you staying logged in to the server console?

What server OS , NT, 2000?

pappy
 
I am running NT. When running the batch manually it works the same as it does with the scheduler. After completing the extract and quiting Access, the error pops up.
 
This is sounding like a timing problem?

Can I suggest it is proper to one of the Access fora?

T
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top