View Single Post
 
Old 05-02-2023, 04:33 PM
savvy savvy is offline Windows 10 Office 2019
Novice
 
Join Date: Aug 2020
Location: Toronto
Posts: 23
savvy is on a distinguished road
Default compile error with checkabort

I get a compile error in msword: method or data member not found

I tried checking the box for Excel Object Library in tools references but cannot debug code:

Sub abc()
Dim restart As Boolean
restart = True
While restart
SendKeys "{NUMLOCK}{ADD}"
Dim key As String
key = ""
While key = ""
DoEvents
If Application.CheckAbort = True Then Exit Sub
If Not Application.CommandBars.GetPressedMso("FilePrint") Is Nothing Then Exit Sub
key = Application.CommandBars.FindControl(ID:=30002).acc Child(1).Caption
Wend
If key = vbCr Then
Call xyz
restart = False
ElseIf key = "{NUMLOCK}{ADD}" Then
'Do nothing, restart loop
Else
restart = False
End If
Wend
End Sub

Not sure how to fix the error.
Reply With Quote