Results 1 to 31 of 31

Thread: problem in closing a error

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2004
    Posts
    681

    Resolved problem in closing a error

    hi
    i have the folowing piece of code

    Call SendMessage(GetWindow(FindWindow("#32770", "Manual Import"), GW_CHILD), BM_CLICK, 0, 0)

    hello = FindWindow("#32770", "Microsoft Visual Basic")

    the first line clicks on a button
    the control goes to next page and all details from clipboeard are copied to this page
    after this a error pops up.....hope can i close that error box.........2nd line is for closing the error box.........but i dont know how to call it after the pasting process is completed

    thanks and regards
    vivek.s
    Last edited by vivek.shankar; Dec 2nd, 2004 at 03:35 PM.

  2. #2
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901
    couldn't you just use an ON ERROR routine? I don't know where the error is occurring, or what it is.

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2004
    Posts
    681
    hi,
    i dont have to resolve the error.........cause i am automating the application using vb code..........and i ahve to close errors wherevre they popup.......well my situation is like this.....

    1) i click on the submit button
    2) in the next page whetever is iin the clipboard gets pasted automatically
    3)now a error message box arises
    4)now i have to close the error b message box.
    5)but problem is i ahve to wait till the pasting operation completes......

    how can i achieve this?

    thanks and regards
    vivek.s

  4. #4

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2004
    Posts
    681
    hi
    like IE_BUSY ..... is tehre any way to wait till pasting operation is complete?

    thanks

    regards
    vivek.s

  5. #5

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2004
    Posts
    681
    HI GURU!!!
    is there any way which i cud make use of?

    thanks and regards
    vivek.s

  6. #6
    VB Code:
    1. While Not hello
    2. hello = FindWindow("#32770", "Microsoft Visual Basic")
    3. Wend

  7. #7

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2004
    Posts
    681
    this will go into infinite loop..........cause the error message box appears after pasting the contents from clipboard........and pasting will not occur and application will hang......
    any other way out?
    thanks and regards
    vivek.s

  8. #8
    not true, when it finds the Window handle the loop is terminated

    but what do you want to do anyway

  9. #9

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2004
    Posts
    681
    i tried it before......

    this is what i want to do

    1) i click on the submit button
    2) in the next page whetever is iin the clipboard gets pasted automatically
    3)now a error message box arises
    4)now i have to close the error b message box.
    5)but problem is i ahve to wait till the pasting operation completes......


    u want me to put this loop between step 1 and step2

    so it hangs up..........i wud like a way to put it between step 2 and step3.........for that we have to know when the pasting operation gets completed.........any options?

    thanks and regards
    vivek.s

  10. #10
    page? what page? please atach your project or something because i dont get the point

  11. #11

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2004
    Posts
    681
    hi,
    well i have attached the screen shot of the form........the error box appears on top..........behind that is the pasted text.........now the error box appears after the text is pasted.........so i have to suppress the error box after the pasting operation gets completed.........

    thanks and regards
    vivek.s

  12. #12
    you forgot the attachment

  13. #13

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2004
    Posts
    681
    hi
    i am not able to attatch the file........it goes to cannot find server page........how can i do it?

    thansk and regards
    vivek.s

  14. #14

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2004
    Posts
    681
    regards
    vivek.s

  15. #15
    when posting a post under reply; under options; you see Atach file,

    zip up your project files first and then just attach the zip file

  16. #16

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2004
    Posts
    681
    hi
    i have jus attached snap shot of screen that i see.....

    thanks and regards
    vivek.s
    Attached Files Attached Files

  17. #17
    how are you pasting? and from what is that error box? maybe you can prevent it from showing up?

  18. #18

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2004
    Posts
    681
    what i am actually doing is .........automating a msaccess application using vb code.......so i am not supposed to touch the msaccess code.........i have to just close any error box that arises......i clicked a button in another form ..........and it opens up this form and copies all the data from clipboard.........and this error message arises after that.......(the error message is due absence of some table i guess......but i am not supposed to do anything with that access application).........now aim is to close that error box.......

    thanks and regards
    vivek.s

  19. #19
    use spy++ to get the class of the error box then use FindWindow API to get the Window Handle(use the loop i gave) then after the loop send a message to the error box using the Window Handle with SendMessage API the message to send is WM_CLOSE

    this mgiht help you

  20. #20

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2004
    Posts
    681
    that was exactly what i did

    Call SendMessage(GetWindow(FindWindow("#32770", "Manual Import"), GW_CHILD), BM_CLICK, 0, 0)

    while hello=0
    hello= FindWindow("#32770", "Microsoft Visual Basic")
    wend



    but what happens is

    Call SendMessage(GetWindow(FindWindow("#32770", "Manual Import"), GW_CHILD), BM_CLICK, 0, 0)

    while hello=0
    hello= FindWindow("#32770", "Microsoft Visual Basic")
    wend

    pasting happens here

    window appears here


    so the loop is making pasting operation wait infinitely.........so i need a way to find when pasting completes.......jus like IE_BUSY for browser


    thanks and regards
    s.vivek

  21. #21
    err.... i have no idea what you are doing.... you might want take a look at MSAccess object for VB6

  22. #22

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2004
    Posts
    681
    sorry........i wud explain more clearly

    this is the button the first form which i am clicking.
    Call SendMessage(GetWindow(FindWindow("#32770", "Manual Import"), GW_CHILD), BM_CLICK, 0, 0)

    now the control is transferred to next form.
    here all the data from clipboard is copied.
    after this a error message box arises.

    now for closing this u wanted me to include the following

    while hello=0
    hello= FindWindow("#32770", "Microsoft Visual Basic")
    wend


    My question is:

    how wud i find when the pasting operation gets completed to use this code

    while hello=0
    hello= FindWindow("#32770", "Microsoft Visual Basic")
    wend


    because if i use this before the text is pasted then the pasting operation would wait infinitely.this is beacuse the error message appears only after pasting operation gets completed.

    thanks and regards
    vivek.s

  23. #23
    whenever the paste operation is completed it would show the error so the loop gets terminated, there it is the solution

  24. #24

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2004
    Posts
    681
    but in this case paste operation does not start till the loop gets completed.so is there anyway to find the completion of paste operation.

    thanks and regards
    vivek.s

  25. #25
    i cant do anything with tis much code

  26. #26

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2004
    Posts
    681
    thsi is the only code in that page...........anyway thanks a lot!!

    Regards
    vivek.s

  27. #27
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709
    vivek, I couldnt view your screen shot, but what are you pasting
    into? Grid, tabel, or ??? Maybe if you already know the number of
    rows you are pasting then perhaps you could make some knind
    of check against the table to see when those number of rows are
    completely added?
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  28. #28

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2004
    Posts
    681
    hi guru,
    yes they r pasting into a table and each line pasted is a record......how can determine the no. of recored from data in clipboard.and even if i do how can follow the no.of recored copied?

    thanks a lot!

    regards
    vivek.s

  29. #29
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709
    Well it would depend on how you are getting the data to the clipboard.
    To check in the access table, get the recordcount before and then
    keep checking until the recordcount mathces your variable that
    would how the rc.

    HTH
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  30. #30

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2004
    Posts
    681
    Thanks a lot!u have given me a cool solotion!i wud implement it!

    thanks a lot!!

    regards
    vivek.s

  31. #31
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709
    No prob. Glad to help
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

Posting Permissions

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



Click Here to Expand Forum to Full Width