Results 1 to 4 of 4

Need help on how to debuggd the following

Threaded View

  1. #1
    Registered User
    Join Date
    11-01-2009
    Location
    California
    MS-Off Ver
    Excel 2013
    Posts
    47

    Need help on how to debuggd the following

    I have some code that calls an external program. I have this being called in a loop. Some times, I will get a "Run-time error -'5'" Invalid Procedure call or argument.
    Is seems that the excel code just needs to refire the same statement.
    How would I do this?

    Here is the segment of code that trips up:
    For I = 1 To 12
                hwnd = FindWindow("#32770", "Advanced Customer Service Representative")
                If hwnd > 0 Then
                
                 If FindWindowEx(hwnd, 0, "Static", "CXC09E - EQUIPMENT NOT FOUND") > 0 Then submitSNtoCSG = "CXC09E - EQUIPMENT NOT FOUND"
                 If FindWindowEx(hwnd, 0, "Static", "Please enter a valid selection criteria.") > 0 Then submitSNtoCSG = "Invalid Selection"
                 If FindWindowEx(hwnd, 0, "Static", "The equipment entered does not belong to a customer." & Chr(10)) > 0 Then submitSNtoCSG = "Not Owned"
                 If submitSNtoCSG = "" Then submitSNtoCSG = "UnKnown"
                
                    
    '
    
    DoEvents
    
    '*********' Need to add in error trap if it errors out, I need to re call the appactivate
    AppActivate ("Advanced Customer Service Representative - Common Search")
     
    SendKeys "{ENTER}", True
    'End If
                
                End If
                '  Debug.Print "I", I
               hnd4 = FindWindow(vbNullString, "Common Search")
               Hnd6 = FindWindowEx(5048016, 0, "Edit", "0015A3186B7F")
           ' EQUIPMENT Not FOUND
        Next I
    Thanks
    Bruce
    Last edited by mctabish; 01-12-2010 at 11:26 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1