Solved

IE tab name reader

Posted on 2011-09-21
9
1,073 Views
Last Modified: 2012-06-27
Hi there -
This is my first post after becoming a member to this forum...
Now, i learning IE automation through VBA and got stuck with 1 point...
1) for Eg: 2 different (URL's ) are running in the each tab. Now i want to know is there a way to progrmatically check what was running in each of the tabs... I agree with the URL link we can directly access but without this option is it possible to check what was running in the IE tabs?
Regards
Satish
0
Comment
Question by:sbabusel
  • 3
  • 2
9 Comments
 
LVL 4

Expert Comment

by:jmdl1983
ID: 36573968
javascript = 'window.location'

asp
<%
function curPageURL()
 dim s, protocol, port

 if Request.ServerVariables("HTTPS") = "on" then
   s = "s"
 else
   s = ""
 end if  
 
 protocol = strleft(LCase(Request.ServerVariables("SERVER_PROTOCOL")), "/") & s

 if Request.ServerVariables("SERVER_PORT") = "80" then
   port = ""
 else
   port = ":" & Request.ServerVariables("SERVER_PORT")
 end if  

 curPageURL = protocol & "://" & Request.ServerVariables("SERVER_NAME") &_
              port & Request.ServerVariables("SCRIPT_NAME")
end function

function strLeft(str1,str2)
 strLeft = Left(str1,InStr(str1,str2)-1)
end function
%>

You can now get the current page URL using the line:

<%  response.write(curPageURL()) %>
0
 

Author Comment

by:sbabusel
ID: 36578041
Thanks for the quick response...I never thought it would be so quick to see a response....very good forum
Now, coming back to the solution actually i want the solution in the VBA format. actually i'm trying to automate from excel..
Thanks
Satish
0
 
LVL 15

Expert Comment

by:Simon Ball
ID: 36598315
I did some resrach on this, there is no easily accessible information about using vba to automate IE with tabs.

one dirty work around i spotted, is that you can set IE on your machine to use new windows instead of tabs...

see the last comment on this interesting blog.

http://vba-corner.livejournal.com/4623.html

the second post here: http://www.vbforums.com/showthread.php?t=512760
suggests creating two windows initially to set your urls in

 
Dim IE As Object
Dim IE2 As Object

Sub Search_Google()

Set IE = CreateObject("InternetExplorer.Application")
IE.Visible = True

IE.Navigate "http://www.google.com" 'load web page google.com

While IE.Busy
  DoEvents  'wait until IE is done loading page.
Wend

Dim LinkHref As String

LinkHref = IE.document.links(0).href


Set IE2 = CreateObject("InternetExplorer.Application")
IE2.Visible = True

IE2.Navigate LinkHref



While IE.Busy
  DoEvents  'wait until IE is done loading page.
Wend


End Sub

Private Sub Command1_Click()

Search_Google
End Sub

Private Sub Form_Unload(Cancel As Integer)
Set IE = Nothing
If TypeName(IE) <> "Nothing" Then Unload IE
Set IE2 = Nothing
If TypeName(IE2) <> "Nothing" Then Unload IE2

End Sub

Open in new window

0
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 

Accepted Solution

by:
sbabusel earned 0 total points
ID: 36599621
Hi there-

Thanks so much for your response. However this will not solve my problem because actually my work space is created using java script. After logging into this system and when i navigate using various option it will create a tab from there we need to work.

Frankly speaking i have tried this method already by opening the desired tab URL separately but it will work as new window it should be always linked to the original IE page....
Note : I have attached the code as well which i'm using to select the correct IE
Please....please help me this is really important for me to automate....

Thanks in advance

Regards,
sbabusel Code.txt
0
 

Author Closing Comment

by:sbabusel
ID: 36938229
i'm forced to close this question as i don't find the answer what i was looking for....very sad experience
0
 
LVL 15

Expert Comment

by:Simon Ball
ID: 36939629
sorry i couldn't help.

I think you needed to put more detail into you original question, e.g. a bit of back ground and mentioning using Javascript there.

There must be someone here who can help you to solve your problem.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

This article is the result of a quest to better understand Task Scheduler 2.0 and all the newer objects available in vbscript in this version over  the limited options we had scripting in Task Scheduler 1.0.  As I started my journey of knowledge I f…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
The viewer will learn how to simulate a series of coin tosses with the rand() function and learn how to make these “tosses” depend on a predetermined probability. Flipping Coins in Excel: Enter =RAND() into cell A2: Recalculate the random variable…
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.

759 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now