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

Macro waits without running!

Status
Not open for further replies.

bobg4u

IS-IT--Management
Jun 3, 2003
46
CA
Hi,
I have a macro that opens a report and saves it as an excel file with format(using the Send Keys),and then emails the excel file.I scheduled this macro to run automatically everyday.I have a strange problem. This macro waits at the point where it has to do the Send Keys. I work in a terminal server environment where I do a remote login.I run the macro and leave that session running and go to my local desktop,and when i return the macro would be waiting,and as soon as I am in the session,it does the send keys(perfectly!). I don't have do anything there - it's just like it runs only when I am 'watching' it!! Because of this the automatic email doesn't work,and i have to manually run the macro(and watch it working!).
Does anyone have a clue about this?

Thanks
bob
 
Bob,

SendKeys is very sensitive to loss of application focus. It may be that this particular problem is a function of it running in a WTS environment. Anyway you could move this to a regular computer?

Dave G.


The Decision Support Group
Reporting Consulting with Cognos BI Tools
"Magic with Data"
[pc2]
Want good answers? Read FAQ401-2487 first!
 
I have the same type of problem. When I run my macro manually, it is strait butter. When I had it scheduled to run this morning at 5:00 am, it was still sitting there when I showed up to work. I think the problem has to do with impromptu having to be on the screen and be the active application in order for the sendkeys to work. For some reason, the visible command doesn't do a thing here if Impromptu is already open. What we need to do is close impromptu before we try to run the report to save to excel with format. I'm going to give it a whirl tomorrow morning, and I'll let you know how it goes.

Chad
 
What I described earlier doesn't seem to work as well as I thought it would. I'll keep messing around and see what I can come up with.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top