SendKeys on a locked PC

D

DS

Afternoon all, hoping someone might be able to offer some advice...

I'm runnining a process that, at one point, uses Application.SendKeys. The
actual process is based on RDB's code for emailing via Excel. Long story
short, I would greatly like to be able to have this run when I am away from
my pc, for example before I get in on a morning, or when I'm having one of
those rare beasts known as "A Day Off".

The problem is that the SendKeys function doesn't work when the pc is locked
- the emails generate fine, but they don't receive the "Application.SendKeys
("%S"), and thus they sit there waiting until I unlock the computer and
manually send. The process isn't interrupted, and continues on its merry way
through to the next parts of the code, the emails just don't send.

With OutMail
.SentOnBehalfOfName = SendingAddress
.To = AddList(n)
.Subject = "Check Results, w/e " & Format(RDt, "DD/MM/YY")
.Body = StrBody
.Attachments.Add (FilePath1)
.Attachments.Add (FilePath2)
.display
End With
Application.Wait (Now + TimeValue("00:00:02"))
Application.SendKeys ("%s")


Does anyone know of a method of either making SendKeys work on a locked pc,
or, just as helpfully, a method of sending this email that will function with
a locked pc and bypass that annoying security warning without manual
intervention (therefore the .send method within the With is no good...)

Many thanks in advance for any advice on this...
 
D

DS

Follow-up:
after doing some more research, I've figured out that this just ain't gonna
work while a pc is locked. Never mind!

Cheers to anyone who had a think about it anyways.
 

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