Solved

IE tab name reader

Posted on 2011-09-21
9
1,133 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
If you need to forecast numbers -- typically for finance -- the Windows and Mac versions of Excel 2016 have a basket of tools to get the job done.
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.

636 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