Results 1 to 18 of 18

Thread: explorer error

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Sep 2005
    Posts
    1,364

    explorer error

    Shell "explorer http://www.vbforums.com/showthread.php?t=365091"

    says the path 365091 doesnt exist..

    and also is it possible to autonavigate explorers like this (like you can do using the webbrowser component)

    i can remember someone said to me

    'to communicate witht yhose windows, you'll need to send window messages with API'

    is this true and has anyone got any more information like this?

  2. #2
    Hyperactive Member eranfox's Avatar
    Join Date
    May 2001
    Posts
    492

    Re: explorer error

    Hello Pouncer,
    try this:
    Shell "D:\Program Files\Internet Explorer\IEXPLORE.EXE http://www.vbforums.com/showthread.php?t=365091"

    the path of my Internet explorer is D:\Program Files\Internet Explorer
    so yo can should change it to your path.
    it will work!!!

    Best Regards,
    ERAN
    Eran Fox
    ASSEMBLER,C,C++,VB6,SQL...

  3. #3

    Thread Starter
    Frenzied Member
    Join Date
    Sep 2005
    Posts
    1,364

    Re: explorer error

    thanks and also can someone give me any more information on

    to communicate witht yhose windows, you'll need to send window messages with API'

  4. #4
    PowerPoster Static's Avatar
    Join Date
    Oct 2000
    Location
    Rochester, NY
    Posts
    9,390

    Re: explorer error

    add reference to MS internet control

    in the general declarations section (All the way at the top)
    put:
    VB Code:
    1. Dim WithEvents IE as InternetExplorer

    then in your click event (or wherever you want to fire it)
    VB Code:
    1. Set IE = New InternetExplorer
    2. IE.Visible = true
    3. IE.Navigate "http://www.vbforums.com/showthread.php?t=365091"

    now.. also.. in the left dropdownbox in the code window (Objects)
    select IE.. you can now tap all the events for IE like BeforeNavigate, DocumentComplete, etc...
    JPnyc rocks!! (Just ask him!)
    If u have your answer please go to the thread tools and click "Mark Thread Resolved"

  5. #5

    Thread Starter
    Frenzied Member
    Join Date
    Sep 2005
    Posts
    1,364

    Re: explorer error

    hey static, thanks for the post dude, very nice.

    so you can do all the events which could be done wioth the webbrowser?

    this is brilliant!!!!

    i will start this!!

  6. #6

    Thread Starter
    Frenzied Member
    Join Date
    Sep 2005
    Posts
    1,364

    Re: explorer error

    hey but like before where i had a loop and set the wb to index 0, can i open up 3 IE's like that tot he same page?

  7. #7
    PowerPoster Static's Avatar
    Join Date
    Oct 2000
    Location
    Rochester, NY
    Posts
    9,390

    Re: explorer error

    here is an example I toyed with to control multiple IE's
    VB Code:
    1. Dim WithEvents IE As InternetExplorer
    2. Dim IES() As InternetExplorer
    3. Private Sub Form_Load()
    4.     ReDim IES(0)
    5.     Set IE = New InternetExplorer
    6.     Set IES(0) = IE
    7.     IES(0).Navigate "www.google.com"
    8.     IES(0).Visible = True
    9.    
    10. End Sub
    11.  
    12. Private Sub IE_DocumentComplete(ByVal pDisp As Object, URL As Variant)
    13.     For x = 0 To UBound(IES)
    14.         If (pDisp Is IES(x).Application) Then
    15.             Debug.Print "IE #" & x
    16.             If UBound(IES) = 4 Then Exit Sub 'added this so it stops at 5 instances
    17.             Add_New_IE
    18.         End If
    19.     Next
    20.    
    21.    
    22. End Sub
    23.  
    24. Private Sub Add_New_IE()
    25.     ReDim Preserve IES(UBound(IES) + 1)
    26.     Set IE = New InternetExplorer
    27.     Set IES(UBound(IES)) = IE
    28.     IES(UBound(IES)).Navigate "www.google.com"
    29.     IES(UBound(IES)).Visible = True
    30. End Sub
    JPnyc rocks!! (Just ask him!)
    If u have your answer please go to the thread tools and click "Mark Thread Resolved"

  8. #8

    Thread Starter
    Frenzied Member
    Join Date
    Sep 2005
    Posts
    1,364

    Re: explorer error

    wow this is very nice thanks man!!! but i got a problem, this doesnt work like it works with webbrowsers.

    IE.Document.Forms(0).Item(2).Value = "hello!!"

    for e.g., thats the edit box on the webpage, like in google , it would work with the webbrowser like

    wb.Document.Forms(0).Item(2).Value = "hello!!"

    but not working with IE, any ideas why?

  9. #9
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: explorer error

    You need to use this component Microsoft HTML Object Library

  10. #10
    PowerPoster Static's Avatar
    Join Date
    Oct 2000
    Location
    Rochester, NY
    Posts
    9,390

    Re: explorer error

    actually you dont dave..

    but you need to hit the right "IE".. remember you have multiple IE's and each one is set to an IES() ...
    IES(0), IES(1)

    IES(0).Document.Forms(0).Item(2).Value = "hello!!"
    or
    IES(1).Document.Forms(0).Item(2).Value = "hello!!"


    the Object library is only needed if you want to set variables to parts of the page..

    Like: Dim HTML as HTMLDocument
    JPnyc rocks!! (Just ask him!)
    If u have your answer please go to the thread tools and click "Mark Thread Resolved"

  11. #11

    Thread Starter
    Frenzied Member
    Join Date
    Sep 2005
    Posts
    1,364

    Re: explorer error

    i tried it but soemthing like this doesnt work

    Set hInp = IE.getElementById("i0116")
    hInp.Value = "hello!!"

  12. #12

    Thread Starter
    Frenzied Member
    Join Date
    Sep 2005
    Posts
    1,364

    Re: explorer error

    Quote Originally Posted by [A51g]Static
    actually you dont dave..

    but you need to hit the right "IE".. remember you have multiple IE's and each one is set to an IES() ...
    IES(0), IES(1)

    IES(0).Document.Forms(0).Item(2).Value = "hello!!"
    or
    IES(1).Document.Forms(0).Item(2).Value = "hello!!"


    the Object library is only needed if you want to set variables to parts of the page..

    Like: Dim HTML as HTMLDocument
    thanks for the reply, at the moment, i only testing with 1 IE, and it doesnt work

    * i did a test:

    wb.Document.Forms(0).Item(2).Value = "hi" - works
    IE.Document.Forms(0).Item(2).Value = "hi" - doesnt work
    Last edited by Pouncer; Oct 11th, 2005 at 03:57 PM.

  13. #13
    PowerPoster Static's Avatar
    Join Date
    Oct 2000
    Location
    Rochester, NY
    Posts
    9,390

    Re: explorer error

    so u just have the single IE declare....

    the webbrowser control is IE so it should work the same
    tested and works:
    VB Code:
    1. Dim WithEvents IE As InternetExplorer
    2.  
    3. Private Sub Form_Load()
    4. Set IE = New InternetExplorer
    5. IE.Navigate "www.google.com"
    6. End Sub
    7.  
    8. Private Sub IE_DocumentComplete(ByVal pDisp As Object, URL As Variant)
    9. If (pDisp Is IE.Application) Then
    10.     IE.Document.Forms(0).q.Value = "hello" 'q is the real NAME from the source
    11.     'tested..works fine
    12. End If
    13. End Sub
    JPnyc rocks!! (Just ask him!)
    If u have your answer please go to the thread tools and click "Mark Thread Resolved"

  14. #14

    Thread Starter
    Frenzied Member
    Join Date
    Sep 2005
    Posts
    1,364

    Re: explorer error

    thank you very much that works, but like you checked the source for the 'q' part, so stuff like Item(1) Item(2) wont work with IE's? So will i have to check the source for every textbox/button i want to click?

    and also something VERY weird is happening, you must see this for yourself!!

    VB Code:
    1. Private Sub IE_DocumentComplete(ByVal pDisp As Object, URL As Variant)
    2. If (pDisp Is IE.Application) Then
    3.     IE.Document.Forms(0).q.Value = "hello" 'q is the real NAME from the source
    4.     'tested..works fine
    5.    
    6.     IE.Document.Forms(0).btnG.Click
    7. End If
    8. End Sub

    when i add the googlesearch button click the browser keeps flickering likes its auto refreshing or something

  15. #15

    Thread Starter
    Frenzied Member
    Join Date
    Sep 2005
    Posts
    1,364

    Re: explorer error

    actually never mind, it does work, even the Item(1) etc, im gona try your loop thing also too. thanks for all help!!

  16. #16

    Thread Starter
    Frenzied Member
    Join Date
    Sep 2005
    Posts
    1,364

    Re: explorer error

    anyone know wy this give me run time error:

    VB Code:
    1. Dim WithEvents IE As InternetExplorer
    2. Dim IES() As InternetExplorer
    3. Private Sub Form_Load()
    4.     ReDim IES(0)
    5.     Set IE = New InternetExplorer
    6.     Set IES(0) = IE
    7.     IES(0).Navigate "www.google.com"
    8.     IES(0).Visible = True
    9.    
    10. End Sub
    11.  
    12. Private Sub IE_DocumentComplete(ByVal pDisp As Object, URL As Variant)
    13.     For x = 0 To UBound(IES)
    14.         If (pDisp Is IES(x).Application) Then
    15.             Debug.Print "IE #" & x
    16.             If UBound(IES) = 2 Then Exit Sub 'added this so it stops at 5 instances
    17.             Add_New_IE
    18.         End If
    19.     Next
    20.    
    21.     If (URL = "http://www.google.co.uk/") Then
    22.         IES(x).Document.Forms(0).q.Value = x
    23.     End If
    24.    
    25. End Sub
    26.  
    27. Private Sub Add_New_IE()
    28.     ReDim Preserve IES(UBound(IES) + 1)
    29.     Set IE = New InternetExplorer
    30.     Set IES(UBound(IES)) = IE
    31.     IES(UBound(IES)).Navigate "www.google.com"
    32.     IES(UBound(IES)).Visible = True
    33. End Sub

    im trying to put the numbers in the google edit box so i can tell it works!!
    its giving a urn time error on:
    IES(x).Document.Forms(0).q.Value = x

  17. #17
    Hyperactive Member eranfox's Avatar
    Join Date
    May 2001
    Posts
    492

    Re: explorer error

    Hello Pouncer,
    I didnt get any run time error but if you want the numbers in the edit boxes
    change the code like this:

    VB Code:
    1. Private Sub Add_New_IE()
    2.     ReDim Preserve IES(UBound(IES) + 1)
    3.     Set IE = New InternetExplorer
    4.     Set IES(UBound(IES)) = IE
    5.     IES(UBound(IES)).Navigate "[B][COLOR=Blue]www.google.co.uk[/COLOR][/B]"
    6.     IES(UBound(IES)).Visible = True
    7. End Sub


    Best Regards,
    ERAN
    Eran Fox
    ASSEMBLER,C,C++,VB6,SQL...

  18. #18
    PowerPoster Static's Avatar
    Join Date
    Oct 2000
    Location
    Rochester, NY
    Posts
    9,390

    Re: explorer error

    Pouncer.. IM'd you with the solution
    JPnyc rocks!! (Just ask him!)
    If u have your answer please go to the thread tools and click "Mark Thread Resolved"

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