Scheduled task to run Macro?

brumshine

Registered User.
Local time
, 18:07
Joined
Dec 17, 2008
Messages
37
I've been trying very, very hard to get a scheduled task to run a macro that I've created. The macro runs a few queries then exports a report to a pdf on a daily basis. If I double click my vbscript file that I created the reports generate correctly. No prompts come up, no errors, works perfect. When I set the vbs to be launched as a scheduled task and stay logged in it works great... When no one is logged into the machine the task hangs at "running" status. I've already made sure that my code does not use any mapped drive letters. Also, I've manually set the macro security level to low before my mdb is accessed.

Any ideas, suggestions, or clues? This is driving me crazy!

Here is the vbscript I'm calling from scheduled tasks...

Code:
Set objLogFile = Nothing
Set objFSO = Nothing
Set objShell = Nothing
dim o
set o=createobject ("Access.Application")
o.automationsecurity=1  ' set macro security LOW.
o.opencurrentdatabase "C:\Mobile Reporting\Management Reports.mdb"
o.visible=true
o.usercontrol=true
set o=nothing

Also, I've made my macro autoExec to avoid having to deal with the command line parameters used to call it...
 
Can you lock the workstation rather than logging off? My first thought is that scheduled tasks don't run if there isn't a logged in user. My second is that even if they do, Access can't run that way.
 
I wish! Locking the workstation sadly is not an option. When I do lock the workstation other users remote into the unit and disconnect my session. They use the machine to access a very expensive single license piece of software installed on the box. Any other ideas?
 
Is it your personal machine? How about a common login so the logged in user doesn't get logged out when they remote in. I have a machine in a remote city that performs numerous scheduled tasks and has a program running that needs to stay running, and that's what I do with it. Several people in my city remote to that PC for various purposes, and we all use the same login.
 
The machine is a set aside workstation at my office. 10 or so different people log into this machine on a daily basis with unique user ids. Having everyone share the same id would be perfect, however I know that won't fly with info security downstairs....
 
Ahh, it's good to be king. I'm head developer, head of network security, head of everything (one-man-band IT dept). My arguments with myself over issues like this are frequent, but I always win. :p

In my case, anything sensitive they might be doing would be with programs that have their own login anyway, so it doesn't really matter that they connect to the machine with a common login.
 

Users who are viewing this thread

Back
Top Bottom