Discussion:
"Microsoft Office Excel is waiting for another application to complete an ole action"
(too old to reply)
colmkav
2012-06-13 07:34:47 UTC
Permalink
Hi,

I get the following message
"Microsoft Office Excel is waiting for another application to complete
an ole action"

when I run a series of Access 2007 queries via VBA code. How can I
stop these messages occuring and what kind of reason does it occur? If
I keep clicking ok I get to the end and everything
runs fine but obviously I dont want this to happen.

Colm
GS
2012-06-13 13:22:46 UTC
Permalink
Post by colmkav
Hi,
I get the following message
"Microsoft Office Excel is waiting for another application to complete
an ole action"
when I run a series of Access 2007 queries via VBA code. How can I
stop these messages occuring and what kind of reason does it occur? If
I keep clicking ok I get to the end and everything
runs fine but obviously I dont want this to happen.
Colm
Show the code!
--
Garry

Free usenet access at http://www.eternal-september.org
ClassicVB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion
Henning
2012-06-13 14:51:58 UTC
Permalink
Post by colmkav
Hi,
I get the following message
"Microsoft Office Excel is waiting for another application to complete
an ole action"
when I run a series of Access 2007 queries via VBA code. How can I
stop these messages occuring and what kind of reason does it occur? If
I keep clicking ok I get to the end and everything
runs fine but obviously I dont want this to happen.
Colm
Some error handling maybe...

/Henning
colmkav
2012-06-13 15:20:16 UTC
Permalink
Post by Henning
Post by colmkav
I get the following message
"Microsoft Office Excel is waiting for another application to complete
an ole action"
when I run a series of Access 2007 queries via VBA code. How can I
stop these messages occuring and what kind of reason does it occur? If
I keep clicking ok I get to the end and everything
runs fine but obviously I dont want this to happen.
Colm
Some error handling maybe...
/Henning
I resolved it by setting:

Application.DisplayAlerts = False
Auric__
2012-06-14 01:00:59 UTC
Permalink
Post by colmkav
Post by Henning
Post by colmkav
Hi,
I get the following message
"Microsoft Office Excel is waiting for another application to
complete an ole action"
when I run a series of Access 2007 queries via VBA code. How can I
stop these messages occuring and what kind of reason does it occur?
If I keep clicking ok I get to the end and everything
runs fine but obviously I dont want this to happen.
Colm
Some error handling maybe...
/Henning
Application.DisplayAlerts = False
That's not "resolved", that's "silenced". Whatever's causing your error is
still happening; you're just not seeing the error messages any more.
--
Words remain my only escape.
GS
2012-06-14 01:33:18 UTC
Permalink
I agree with Auric_! Again.., *show the code*!
--
Garry

Free usenet access at http://www.eternal-september.org
ClassicVB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion
colmkav
2012-06-14 07:45:25 UTC
Permalink
Post by colmkav
Hi,
I get the following message
"Microsoft Office Excel is waiting for another application to complete
an ole action"
when I run a series of Access 2007 queries via VBA code. How can I
stop these messages occuring and what kind of reason does it occur? If
I keep clicking ok I get to the end and everything
runs fine but obviously I dont want this to happen.
Colm
Ok here is the code:

Private Sub CommandButton2_Click()
Dim wsSettings As Worksheet
Dim sDBDailyMonitoring As String

Application.DisplayAlerts = False
Application.ScreenUpdating = False

Set wsSettings = ThisWorkbook.Worksheets("Settings")
sDBDailyMonitoring = wsSettings.Range("DailyMonitoringDB")

CreateReports sDBDailyMonitoring

Application.DisplayAlerts = True
Application.ScreenUpdating = True

MsgBox "Process Complete: " & Time

End Sub

Sub CreateReports(sDBDailyMonitoring As String)
'run the report queries and store in the report tables

Dim rgCursor As Range
Dim l_objDailyMonitoring As New clsDailyMonitoringDB
Dim ws As Worksheet
Dim sQryName As String
Dim l_QryDef As QueryDef
Dim dtContextDate As Date

l_objDailyMonitoring.OpenDatabase sDBDailyMonitoring
Set ws = ThisWorkbook.Worksheets("Settings")
dtContextDate = ws.Range("ContextDate").Value

Set rgCursor = ws.Range("QueryList").Offset(1, 0)
Do While Not rgCursor = ""
sQryName = rgCursor.Value
'run SQL maketable query which put results in new table
If rgCursor.Offset(0, -1) = True Then
l_objDailyMonitoring.RunRuleQuery sQryName, dtContextDate
End If
' l_objDailyMonitoring.RunReportQuery sQryName
Set rgCursor = rgCursor.Offset(1, 0)
Loop
l_objDailyMonitoring.CloseDatabase

Exit Sub

ERR_HANDLER:
MsgBox "Error: " & Err.Description, vbExclamation
l_objDailyMonitoring.CloseDatabase

End Sub
Deanna Earley
2012-06-14 08:52:34 UTC
Permalink
Post by colmkav
Hi,
I get the following message
"Microsoft Office Excel is waiting for another application to complete
an ole action"
when I run a series of Access 2007 queries via VBA code. How can I
stop these messages occuring and what kind of reason does it occur? If
I keep clicking ok I get to the end and everything
runs fine but obviously I dont want this to happen.
It's caused by you interacting with the Excel application while it's
calling into Access (which means it needs to handle messages for the COM
part but is not in a position to do so for anything else)

As you can see, you can turn them off, or just don't try and do that :)
Maybe displaying an "I'm busy" dialog will deter the user :)
--
Deanna Earley (***@icode.co.uk)
i-Catcher Development Team
http://www.icode.co.uk/icatcher/

iCode Systems

(Replies direct to my email address will be ignored.
Please reply to the group.)
colmkav
2012-06-14 09:39:21 UTC
Permalink
Post by Deanna Earley
Post by colmkav
Hi,
I get the following message
"Microsoft Office Excel is waiting for another application to complete
an ole action"
when I run a series of Access 2007 queries via VBA code. How can I
stop these messages occuring and what kind of reason does it occur? If
I keep clicking ok I get to the end and everything
runs fine but obviously I dont want this to happen.
It's caused by you interacting with the Excel application while it's
calling into Access (which means it needs to handle messages for the COM
part but is not in a position to do so for anything else)
As you can see, you can turn them off, or just don't try and do that :)
Maybe displaying an "I'm busy" dialog will deter the user :)
--
i-Catcher Development Team
http://www.icode.co.uk/icatcher/
iCode Systems
(Replies direct to my email address will be ignored.
Please reply to the group.)
thanks but it seems to do it even if I dont touch my PC. I dont touch Excel other than to click <OK> to these messages.
ralph
2012-06-14 22:12:26 UTC
Permalink
On Thu, 14 Jun 2012 02:39:21 -0700 (PDT), colmkav
Post by colmkav
Post by Deanna Earley
Post by colmkav
Hi,
I get the following message
"Microsoft Office Excel is waiting for another application to complete
an ole action"
when I run a series of Access 2007 queries via VBA code. How can I
stop these messages occuring and what kind of reason does it occur? If
I keep clicking ok I get to the end and everything
runs fine but obviously I dont want this to happen.
It's caused by you interacting with the Excel application while it's
calling into Access (which means it needs to handle messages for the COM
part but is not in a position to do so for anything else)
As you can see, you can turn them off, or just don't try and do that :)
Maybe displaying an "I'm busy" dialog will deter the user :)
--
i-Catcher Development Team
http://www.icode.co.uk/icatcher/
iCode Systems
(Replies direct to my email address will be ignored.
Please reply to the group.)
thanks but it seems to do it even if I dont touch my PC.
I dont touch Excel other than to click <OK> to these messages.
A Windows Debugger would be helpful to isolate the issue, but depends
on how much experience you have had with using one and your knowledge
of Excel/VBA internals.

The most common cause if not related to any obvious activity is
Add-Ins. Open excel and remove all Add-Ins then test. If no error then
add them back, one at a time, until you find the one causing the
problem.

The second most common reason is using implict references within your
VBA code. Replace them with explict references. Related to this is
unwittingly making extraneous calls to other objects while you think
you are only dealing with one.

Turning off "error catching" while not the optimum solution is the
most frequent solution for most users, as the basic issue tends to be
benign.

We need to see some code.

-ralph

Loading...