Scheduled Macro hanging

K

Kayda

Hi:

I have an Access 2003 macro running on a Windows 2003 server box. I am
logged into the box as Administrator. The macro runs fine when I run
the shortcut to the macro manually by clicking on it. However, when I
schedule it, it shows in the task scheduler window as "running" and
doesn't finish. I scheduled the task to run using the same
Administrator user. Also, I ensured no pop up would come by disabling
the Tools Options Edit/Find prompts, and set the macro security to
"low". As I said, when I run it manually it runs fine with no prompts.

The macro only queries a table and does a few appends, and then closes
access using "Quit". Any ideas why it might be hanging?

Thanks,
Kayda
 
K

Kayda

Actually, I have found that it stays in "running" state because, even
though I issue a "Quit" in the Access macro, if I look at Task Manager
the "MSACCESS.EXE" is still loaded in memory using 0 CPU. If I delete
the scheduled task and schedule again it creates a second msaccess.exe
process. It seems to work every time, as long as I create a new task--
if I just edit the properties of the scheduled task to move up the
time to get it to run again--it doesn't work then.

Has anyone experienced this? How do I ensure the MSACCESS process is
killed every time?

Thanks,
Kayda
 
K

Kayda

My solution here is to get rid of the "Quit" command in the macro and
instead run a simple batch file I created with the following line:

TASKKILL /F /IM "MSACCESS.EXE"

I can be pretty sure no one else is running Access on the machine,
otherwise I imagine I would have to figure out the PID and kill the
process that way. I just call the accesskill.bat from the macro and
that seems to work. I'm curious if anyone else has had to use the
approach?
 
G

Guest

I have a similar situation where we are trying to run a Module via Task
Sceduler. If we log onto the server with an account with domain admin
privileges, the task will run and complete as intended. If we schedule the
task with the same account, it will start and then hang similar to what you
were seeing on your situation. In looking at Task Manager, there are two
instances of MSACCESS, which seems to be appropriate. The main difference is
that short of logging onto the server, we can't get this task to run via the
scheduler.

We were thinking it was an issue with Access interacting properly with the
OS somehow. Haven't found a solution yet though.
 
G

Guest

I had a similar problem and I created a macro that would do what I wanted and
then I exported the macro as a shortcut to my desktop (or whereever the task
scheduler is pointing) and I would point the scheduler directly to the macro
and the macro would execute fine.

Raymond
 

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