muzak
asked on
Regain Focus After Shell Call
I have a VBA event that calls a proprietary query program to gather information, then send it to Excel. Since the Query program Opens Excel, Access loses focus and will error if I don't click on Form Icon in taskbar, to regain focus to Access, after Excel opens and before sleep timer expires.
The following is semi-pseudo code of what I am Doing:
PRG_ID = Shell(Query_Program,6)
Sleep (15000)
Set ObjExcel = GetObject(, "excel.application")
ObjExcel.Application.Visib le = False
ObjExcel.Application.Displ ayAlerts = False
ObjExcel.Activeworkbook.Sa ve
ObjExcel.Quit
Any Thought???
Thanks
The following is semi-pseudo code of what I am Doing:
PRG_ID = Shell(Query_Program,6)
Sleep (15000)
Set ObjExcel = GetObject(, "excel.application")
ObjExcel.Application.Visib
ObjExcel.Application.Displ
ObjExcel.Activeworkbook.Sa
ObjExcel.Quit
Any Thought???
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks....