Ask Question Forum:
Model Library:2025-02-08:A.I. model is online auto reply
C
O
M
P
U
T
E
R
2
8
Show
#
ASK
RECENT
←
- Underline
- Bold
- Italic
- Indent
- Step
- Bullet
- Quote
- Cut
- Copy
- Paste
- Table
- Spelling
- Find & Replace
- Undo
- Redo
- Link
- Attach
- Clear
- Code
Below area will not be traslated by Google,you can input code or other languages
Hint:If find spelling error, You need to correct it,1 by 1 or ignore it (code area won't be checked).
X-position of the mouse cursor
Y-position of the mouse cursor
Y-position of the mouse cursor
Testcursor
caretPos
Attachment:===
Asked by duncanb7
at 2024-02-27 05:53:05
Point:500 Replies:14 POST_ID:828444USER_ID:11059
Topic:
Hypertext Markup Language (HTML);;Visual Basic Programming
I am going through the long time process to create one IE object or window . and I plan not to quit the IE instance/window
until the computer is shut down. The current IE window will be used for other new VBA automation program. But
I don't know how to transfer the object information or property of the current/existing IE window to the new IE object which
created from the new VBA program. I read some help that mention use shellwindow to grab the exsitng
IE window object information and property at http://bytes.com/topic/visual-basic-net/answers/353392-how-access-current-internet-explorer-vb-net,
but it is not clear for me. Any code provide for the problem of newIE.navigate URL on the existing IE window? please advise
Thanks
Duncan
until the computer is shut down. The current IE window will be used for other new VBA automation program. But
I don't know how to transfer the object information or property of the current/existing IE window to the new IE object which
created from the new VBA program. I read some help that mention use shellwindow to grab the exsitng
IE window object information and property at http://bytes.com/topic/visual-basic-net/answers/353392-how-access-current-internet-explorer-vb-net,
but it is not clear for me. Any code provide for the problem of newIE.navigate URL on the existing IE window? please advise
Thanks
Duncan
Author: duncanb7 replied at 2024-02-28 03:59:41
Got it , anyway thanks for sharing
Expert: SiddharthRout replied at 2024-02-28 03:54:19
duncanb7: You are very kind but you should never do that ;)
If you have found an answer by yourself then post that here and then accept your answer and close the question. You don't need to delete it. :) This will also help other people who come searching for similar answers :)
Sid
If you have found an answer by yourself then post that here and then accept your answer and close the question. You don't need to delete it. :) This will also help other people who come searching for similar answers :)
Sid
Author: duncanb7 replied at 2024-02-28 03:51:45
Yes it is correct totally , and I found the solution yesterday from this wbesite
http://vba-corner.livejournal.com/4623.html but won't want to delete the
question. ANywaym you deserve the point
http://vba-corner.livejournal.com/4623.html but won't want to delete the
question. ANywaym you deserve the point
Author: duncanb7 replied at 2024-02-28 03:51:24
Yes it is correct totally , and I found the solution yesterday from this wbesite
http://vba-corner.livejournal.com/4623.html but won't want to delete the
question. ANywaym you deserve the point
http://vba-corner.livejournal.com/4623.html but won't want to delete the
question. ANywaym you deserve the point
Accepted Solution
Expert: SiddharthRout replied at 2024-02-28 03:48:19
500 points EXCELLENT
Oh Ok.
Like this?
Like this?
Sub Sample() Dim SW, IE Set SW = CreateObject("Shell.Application") For Each IE In SW.Windows If TypeName(IE.Document) = "HTMLDocument" Then If IE.LocationURL = "http://in.yahoo.com/?p=us" Then _ IE.Navigate "www.Google.com" End If NextEnd Sub 1:2:3:4:5:6:7:8:9:10:11:
Sid
Author: duncanb7 replied at 2024-02-28 03:45:02
For example,
now you open example IE window by clicking on the IE icon on desktop windows abd browser to www.yahoo.com
and the IE titlte would be Yahoo!--Windower Explorer.
and then now you use new VBA program for navigate example URL like www.goggle.com but you could NOT create
new IE object for browsing , you need to navigate the URL on the opened window with the title Yahoo!-Window
now you open example IE window by clicking on the IE icon on desktop windows abd browser to www.yahoo.com
and the IE titlte would be Yahoo!--Windower Explorer.
and then now you use new VBA program for navigate example URL like www.goggle.com but you could NOT create
new IE object for browsing , you need to navigate the URL on the opened window with the title Yahoo!-Window
Expert: SiddharthRout replied at 2024-02-28 03:37:59
Ok Correct me if I am wrong. What I understood from your query is that you have opened IE from a different program and now you want to use that IE from VBA?
If not, then yes, if you can explain more then maybe I can give you the exact solution :)
Sid
If not, then yes, if you can explain more then maybe I can give you the exact solution :)
Sid
Author: duncanb7 replied at 2024-02-28 03:37:23
In other words, the opened IE windows is created seperately from my program.
Probably, we might use SHDocVw.ShellWindows
to find the target title window first before navigate URL
Probably, we might use SHDocVw.ShellWindows
to find the target title window first before navigate URL
Author: duncanb7 replied at 2024-02-28 03:32:22
Opened IE windows means that is not opened on my working program and it might create by
other program using other lanugage
other program using other lanugage
Author: duncanb7 replied at 2024-02-28 03:30:25
Actually do you understand my question, i could explan more, and I don't know your question means ?(And if there is no existing or opened IE?)
Expert: SiddharthRout replied at 2024-02-28 03:27:29
And if there is no existing or opened IE?
Sid
Sid
Author: duncanb7 replied at 2024-02-28 03:26:59
I mean I navigate URL on the existing or opened IE windows not on the new IE window or object
Author: duncanb7 replied at 2024-02-28 03:26:27
I mean I navigate URL on the existing or opened IE windows
Expert: SiddharthRout replied at 2024-02-28 03:23:03
You don't need to use Shell for this. You can use CreateObject in VBA.
And once you are done simply use
Object.Quit
and then
Set Object = Nothing
See the example below.
And once you are done simply use
Object.Quit
and then
Set Object = Nothing
See the example below.
Dim browser As ObjectPrivate Sub IEObj() On Error GoTo ErrIE Set browser = CreateObject("InternetExplorer.Application") browser.Visible = True browser.Navigate ("http://koolsid.com") '~~> You can now use 'browser' object in your code '~~> till the time you destroy it. 'browser.Quit 'Set browser = Nothing Exit SubErrIE: MsgBox Err.DescriptionEnd Sub 1:2:3:4:5:6:7:8:9:10:11:12:13:14:15:16:17:18:19:20:21:
Sid