TullTigger
New Member
- Joined
- Dec 7, 2009
- Messages
- 7
Hello,
I'm building class modules for the first time & experiencing some unexpected behavior.
I'm hoping that a new set of eyes can tell me what I'm doing wrong, or tell me that this is a VBA bug.
I'm working in XP, using Excel 2002/VBA 6.3.
Here is the method in my class module:
(the PCOMM.autECLPSObj dll is a set of automation objects for our AS400 system.)
After running this method in a standard module, I get this result in the immediate window:
True
Timeout Occurred when waiting for string: MENU-110
For some reason VBA isn't recognizing that "WaitForStringInRect" is True when it evaluates the If Not Then...
When stepping thru the code & hovering over WaitForStringInRect, the value shows true before executing that part of the statement.
Any ideas what is going on here?
Thanks in advance for your time.
I'm building class modules for the first time & experiencing some unexpected behavior.
I'm hoping that a new set of eyes can tell me what I'm doing wrong, or tell me that this is a VBA bug.
I'm working in XP, using Excel 2002/VBA 6.3.
Here is the method in my class module:
Code:
Function WaitForStringInRect(ByVal WaitString As String, _
Optional ByVal sRow As Integer = 1, Optional ByVal sCol As Integer = 1, _
Optional ByVal eRow As Integer = 24, Optional ByVal eCol As Integer = 80, _
Optional ByVal TimeOut As Variant = lngTIMEOUT, _
Optional ByVal bWaitForIr As Boolean = True, _
Optional ByVal bCaseSens As Boolean = False) As Boolean
On Error GoTo errProc
'''''''''''''''''''''''''
Dim autECLPSObj As Object
'''''''''''''''''''''''''
Set autECLPSObj = CreateObject("PCOMM.autECLPS")
autECLPSObj.SetConnectionByName Me.SessionID
'''''''''''''''''''''''''
WaitForStringInRect = autECLPSObj.WaitForStringInRect(WaitString, sRow, sCol, eRow, eCol, TimeOut, bWaitForIr, bCaseSens)
Debug.Print WaitForStringInRect
If Not WaitForStringInRect Then
Debug.Print "Timeout Occurred when waiting for string: " & WaitString
End If
errProc:
'''''''''''''''''''''''''
Set autECLPSObj = Nothing
End Function
(the PCOMM.autECLPSObj dll is a set of automation objects for our AS400 system.)
After running this method in a standard module, I get this result in the immediate window:
True
Timeout Occurred when waiting for string: MENU-110
For some reason VBA isn't recognizing that "WaitForStringInRect" is True when it evaluates the If Not Then...
When stepping thru the code & hovering over WaitForStringInRect, the value shows true before executing that part of the statement.
Any ideas what is going on here?
Thanks in advance for your time.