Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

IE tab name reader

Posted on 2011-09-21
9
Medium Priority
?
1,168 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
6 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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 

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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

How to get Spreadsheet Compare 2016 working with the 64 bit version of Office 2016
This article describes a serious pitfall that can happen when deleting shapes using VBA.
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 demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

571 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