Can VBA Programs Run on a Locked PC

W

Wayne

I have a Excel VBA program that requires around 10 hours of run time.
It accesses multiple files and extracts data. I would like to lock my
PC while the PC is running. The program runs fine as long as I don't
lock (ctrl-alt-del-enter) the PC. I've tried inserting the
LockWorkStation function (see below) in various spots in my code which
does lock the PC but the program still stops running.

Private Declare Function LockWorkStation Lib "user32.dll" () As Long

Does VBA only run on an unlocked PC?
 
J

Jim Cone

Most keyboard commands will not interfere with a running macro.
A hand lettered sign placed on the computer, with a date, stating that
a program is running should prevent interruption by co-workers.
However...

The Application.Interactive property may do what you want or
even the Application.EnableCancelKey property.
Be careful what you wish for. <g>

Not much can prevent someone, up to no good, from cutting off the power.
--
Jim Cone
Portland, Oregon USA



"Wayne" <[email protected]>
wrote in message
I have a Excel VBA program that requires around 10 hours of run time.
It accesses multiple files and extracts data. I would like to lock my
PC while the PC is running. The program runs fine as long as I don't
lock (ctrl-alt-del-enter) the PC. I've tried inserting the
LockWorkStation function (see below) in various spots in my code which
does lock the PC but the program still stops running.

Private Declare Function LockWorkStation Lib "user32.dll" () As Long

Does VBA only run on an unlocked PC?
 

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