C
CLarkou
I have an MSAccess 2000 program which opens excel for sending data.
Many times while trying to open Excel, it stops and excel does not
open. By pressing BREAK from keyboard, excel opens and continues
without any problem. Why this is happening ?
For opening excel I am using the following code:
'get EXCEL if open
Set exl_APP = GetObject(, "Excel.application")
var_obj_name = exl_APP.Name
'EXCEL is not open
If Err Then
var_EXCEL_ID = Shell("Excel", vbMaximizedFocus) 'open excel
DoEvents
SendKeys "%{TAB}"
SendKeys "%{TAB}"
Do
'select form in order focus from excel to return to access
DoCmd.SelectObject acForm, "interrupt"
'get EXCEL if open
Set exl_APP = GetObject(, "Excel.application")
On Error Resume Next
var_obj_name = exl_APP.Name
Loop While Err And (Timer - var_timer < 20)
End If
Many times while trying to open Excel, it stops and excel does not
open. By pressing BREAK from keyboard, excel opens and continues
without any problem. Why this is happening ?
For opening excel I am using the following code:
'get EXCEL if open
Set exl_APP = GetObject(, "Excel.application")
var_obj_name = exl_APP.Name
'EXCEL is not open
If Err Then
var_EXCEL_ID = Shell("Excel", vbMaximizedFocus) 'open excel
DoEvents
SendKeys "%{TAB}"
SendKeys "%{TAB}"
Do
'select form in order focus from excel to return to access
DoCmd.SelectObject acForm, "interrupt"
'get EXCEL if open
Set exl_APP = GetObject(, "Excel.application")
On Error Resume Next
var_obj_name = exl_APP.Name
Loop While Err And (Timer - var_timer < 20)
End If