|
-
Oct 11th, 2005, 02:44 PM
#1
Thread Starter
Frenzied Member
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?
-
Oct 11th, 2005, 02:53 PM
#2
Hyperactive Member
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...
-
Oct 11th, 2005, 03:00 PM
#3
Thread Starter
Frenzied Member
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'
-
Oct 11th, 2005, 03:03 PM
#4
Re: explorer error
add reference to MS internet control
in the general declarations section (All the way at the top)
put:
VB Code:
Dim WithEvents IE as InternetExplorer
then in your click event (or wherever you want to fire it)
VB Code:
Set IE = New InternetExplorer
IE.Visible = true
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"
-
Oct 11th, 2005, 03:08 PM
#5
Thread Starter
Frenzied Member
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!!
-
Oct 11th, 2005, 03:23 PM
#6
Thread Starter
Frenzied Member
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?
-
Oct 11th, 2005, 03:26 PM
#7
Re: explorer error
here is an example I toyed with to control multiple IE's
VB Code:
Dim WithEvents IE As InternetExplorer
Dim IES() As InternetExplorer
Private Sub Form_Load()
ReDim IES(0)
Set IE = New InternetExplorer
Set IES(0) = IE
IES(0).Navigate "www.google.com"
IES(0).Visible = True
End Sub
Private Sub IE_DocumentComplete(ByVal pDisp As Object, URL As Variant)
For x = 0 To UBound(IES)
If (pDisp Is IES(x).Application) Then
Debug.Print "IE #" & x
If UBound(IES) = 4 Then Exit Sub 'added this so it stops at 5 instances
Add_New_IE
End If
Next
End Sub
Private Sub Add_New_IE()
ReDim Preserve IES(UBound(IES) + 1)
Set IE = New InternetExplorer
Set IES(UBound(IES)) = IE
IES(UBound(IES)).Navigate "www.google.com"
IES(UBound(IES)).Visible = True
End Sub
JPnyc rocks!! (Just ask him!)
If u have your answer please go to the thread tools and click "Mark Thread Resolved"
-
Oct 11th, 2005, 03:32 PM
#8
Thread Starter
Frenzied Member
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?
-
Oct 11th, 2005, 03:35 PM
#9
Re: explorer error
You need to use this component Microsoft HTML Object Library
-
Oct 11th, 2005, 03:47 PM
#10
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"
-
Oct 11th, 2005, 03:48 PM
#11
Thread Starter
Frenzied Member
Re: explorer error
i tried it but soemthing like this doesnt work
Set hInp = IE.getElementById("i0116")
hInp.Value = "hello!!"
-
Oct 11th, 2005, 03:53 PM
#12
Thread Starter
Frenzied Member
Re: explorer error
 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.
-
Oct 11th, 2005, 04:01 PM
#13
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:
Dim WithEvents IE As InternetExplorer
Private Sub Form_Load()
Set IE = New InternetExplorer
IE.Navigate "www.google.com"
End Sub
Private Sub IE_DocumentComplete(ByVal pDisp As Object, URL As Variant)
If (pDisp Is IE.Application) Then
IE.Document.Forms(0).q.Value = "hello" 'q is the real NAME from the source
'tested..works fine
End If
End Sub
JPnyc rocks!! (Just ask him!)
If u have your answer please go to the thread tools and click "Mark Thread Resolved"
-
Oct 11th, 2005, 04:06 PM
#14
Thread Starter
Frenzied Member
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:
Private Sub IE_DocumentComplete(ByVal pDisp As Object, URL As Variant)
If (pDisp Is IE.Application) Then
IE.Document.Forms(0).q.Value = "hello" 'q is the real NAME from the source
'tested..works fine
IE.Document.Forms(0).btnG.Click
End If
End Sub
when i add the googlesearch button click the browser keeps flickering likes its auto refreshing or something
-
Oct 11th, 2005, 04:34 PM
#15
Thread Starter
Frenzied Member
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!!
-
Oct 11th, 2005, 04:48 PM
#16
Thread Starter
Frenzied Member
Re: explorer error
anyone know wy this give me run time error:
VB Code:
Dim WithEvents IE As InternetExplorer
Dim IES() As InternetExplorer
Private Sub Form_Load()
ReDim IES(0)
Set IE = New InternetExplorer
Set IES(0) = IE
IES(0).Navigate "www.google.com"
IES(0).Visible = True
End Sub
Private Sub IE_DocumentComplete(ByVal pDisp As Object, URL As Variant)
For x = 0 To UBound(IES)
If (pDisp Is IES(x).Application) Then
Debug.Print "IE #" & x
If UBound(IES) = 2 Then Exit Sub 'added this so it stops at 5 instances
Add_New_IE
End If
Next
If (URL = "http://www.google.co.uk/") Then
IES(x).Document.Forms(0).q.Value = x
End If
End Sub
Private Sub Add_New_IE()
ReDim Preserve IES(UBound(IES) + 1)
Set IE = New InternetExplorer
Set IES(UBound(IES)) = IE
IES(UBound(IES)).Navigate "www.google.com"
IES(UBound(IES)).Visible = True
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
-
Oct 12th, 2005, 02:12 AM
#17
Hyperactive Member
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:
Private Sub Add_New_IE()
ReDim Preserve IES(UBound(IES) + 1)
Set IE = New InternetExplorer
Set IES(UBound(IES)) = IE
IES(UBound(IES)).Navigate "[B][COLOR=Blue]www.google.co.uk[/COLOR][/B]"
IES(UBound(IES)).Visible = True
End Sub
Best Regards,
ERAN
Eran Fox
ASSEMBLER,C,C++,VB6,SQL...
-
Oct 12th, 2005, 07:34 AM
#18
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|