+ Reply to Thread
Results 1 to 4 of 4

Need help on how to debuggd the following

Hybrid View

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

    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.

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Need help on how to debuggd the following

    Please take a few minutes to read the forum rules, and then amend your thread title accordingly.

    Thanks.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Need help on how to debuggd the following

    Your post does not comply with Rule 1 of our Forum RULES. Your post title should accurately and concisely describe your problem, not your anticipated solution. Use terms appropriate to a Google search. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will be addressed according to the OP's experience in the forum: If you have less than 10 posts, expect (and respond to) a request to change your thread title. If you have 10 or more posts, expect your post to be locked, so you can start a new thread with an appropriate title.
    To change a Title on your post, click EDIT then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.

    Please do as shg suggests
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

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

    Re: Need help on how to debuggd the following

    Sorry for the inaccurate title. I DO know better than this and I deserve any public floggin' that is aimed at me (but no flames please!!!!)

    I have actually solved this issue.

+ Reply to Thread

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