S
SchoutenCC
Hi All,
I've made a couple of macros which are giving me errors and I just
cannot figure out how to get rid of these. Hope anybody here can help
me.
I'm getting the following errors:
- Excel is Waiting for another Application to complete OLE Action
Have tried the suggestion from
http://groups.google.com.au/group/m...r+application+to+complete+an+OLE+action&hl=en
but it still displays the error message for me.
- Method delete of class picture cannot be found
Have tried the suggestion from
http://groups.google.com/group/micr...fc62e1942178?hl=nl&lnk=st&q=#95aafc62e1942178
but it still displays the error message for me.
So, basically I'm starting to think I'm implementing the solutions
incorrectly.
Here is part of my VBA: (Alt-F11 --> VBAProject (Macro-menu.xls) -->
Modules --> Module1
---
Option Explicit
Private Declare Function CoRegisterMessageFilter Lib
"OLE32.DLL" (ByVal lFilterIn As Long, ByRef lPreviousFilter) As Long
Sub CPO()
'Hide OLE blocked process message box & disable events
'On Error Resume Next
Dim lMsgFilter As Long
CoRegisterMessageFilter 0&, lMsgFilter
Application.EnableEvents = False
(...)
'Prepare objects
Dim xlApp As Object: Set xlApp = New Excel.Application
xlApp.Visible = True: xlApp.Interactive = True
xlApp.Application.Workbooks.Open sPathJet
'--> XLA add-in
Dim oDist: Set oDist = CreateObject("PdfDistiller.PdfDistiller")
'--> Using one CreateObject statement, found elsewhere this might
cause a problem
'Open CPO file and update
xlApp.Application.Workbooks.Open sPathCpo
(...)
xlApp.Application.Run Dir(sPathJet) & "!JetMenu", "Report"
'--> The error occurs usually while Jet is updating its report
(sometimes lasting over two hours), but with unpredictable intervals/
not at reproducible moments
(...)
oDist.FileToPdf sFilename & ".ps", sFilename & ".pdf", ""
'--> Using an often-suggested PDF-conversion statement
(...)
MyWorkbook.Close SaveChanges:=False
xlApp.Quit
'Restore OLE blocked process message box & enable events
CoRegisterMessageFilter lMsgFilter, lMsgFilter
Application.EnableEvents = True
End Sub
I've made a couple of macros which are giving me errors and I just
cannot figure out how to get rid of these. Hope anybody here can help
me.
I'm getting the following errors:
- Excel is Waiting for another Application to complete OLE Action
Have tried the suggestion from
http://groups.google.com.au/group/m...r+application+to+complete+an+OLE+action&hl=en
but it still displays the error message for me.
- Method delete of class picture cannot be found
Have tried the suggestion from
http://groups.google.com/group/micr...fc62e1942178?hl=nl&lnk=st&q=#95aafc62e1942178
but it still displays the error message for me.
So, basically I'm starting to think I'm implementing the solutions
incorrectly.
Here is part of my VBA: (Alt-F11 --> VBAProject (Macro-menu.xls) -->
Modules --> Module1
---
Option Explicit
Private Declare Function CoRegisterMessageFilter Lib
"OLE32.DLL" (ByVal lFilterIn As Long, ByRef lPreviousFilter) As Long
Sub CPO()
'Hide OLE blocked process message box & disable events
'On Error Resume Next
Dim lMsgFilter As Long
CoRegisterMessageFilter 0&, lMsgFilter
Application.EnableEvents = False
(...)
'Prepare objects
Dim xlApp As Object: Set xlApp = New Excel.Application
xlApp.Visible = True: xlApp.Interactive = True
xlApp.Application.Workbooks.Open sPathJet
'--> XLA add-in
Dim oDist: Set oDist = CreateObject("PdfDistiller.PdfDistiller")
'--> Using one CreateObject statement, found elsewhere this might
cause a problem
'Open CPO file and update
xlApp.Application.Workbooks.Open sPathCpo
(...)
xlApp.Application.Run Dir(sPathJet) & "!JetMenu", "Report"
'--> The error occurs usually while Jet is updating its report
(sometimes lasting over two hours), but with unpredictable intervals/
not at reproducible moments
(...)
oDist.FileToPdf sFilename & ".ps", sFilename & ".pdf", ""
'--> Using an often-suggested PDF-conversion statement
(...)
MyWorkbook.Close SaveChanges:=False
xlApp.Quit
'Restore OLE blocked process message box & enable events
CoRegisterMessageFilter lMsgFilter, lMsgFilter
Application.EnableEvents = True
End Sub