Solved

IE tab name reader

Posted on 2011-09-21
9
1,084 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.

920 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

14 Experts available now in Live!

Get 1:1 Help Now