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)
Set ObjExcel = GetObject(, "excel.application")
ObjExcel.Application.Visible = False
ObjExcel.Application.DisplayAlerts = False