Solved

IE tab name reader

Posted on 2011-09-21
9
1,092 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
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
Do you use a spreadsheet like Microsoft's Excel?  Have you ever wanted to link out to a non excel file on your computer or network drive?  This is the way I found to do it!
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
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 …

777 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