Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > VBA / Office Integration > Excel > Working with IE, FRAMES and JAVA from Excel (or any VBA)


Reply
 
Thread Tools Display Modes
  #1  
Old 06-24-2010, 08:41 PM
mctabish mctabish is offline
Newcomer
 
Join Date: May 2009
Posts: 6
Default Working with IE, FRAMES and JAVA from Excel (or any VBA)


I have the need to work from a secure intranet website that uses FRAMES and JAVA.
I can get up to a certain point, and have figured out how to do what I need to do ONCE I am past this point.

What I need to do is to click on an icon/link that is in a FRAME. The link text is "HAYWARD CP SW" and an IP address (I have tried to navagate to that IP, but it is not accessable.) I know that the FRAME is frame #2 (third frame) as I can get its name etc from my code and it matches the webpage.
Code:
Sub findelement(oSafari As Object) 'oSafari is the IE object.
Dim mywb As Object
Dim myHTMLDoc As HTMLDocument
Dim myHTMLFrame4 As HTMLDocument



'get the webbrowser - here mine is name wb_Name
Set mywb = oSafari

'get the main HTML Document
Set myHTMLDoc = mywb.document
Set myHTMLFrame4 = myHTMLDoc.frames(2).document
DoEvents
'this will show you the outerHTML and I imagine your table.
Debug.Print myHTMLFrame4.DocumentElement.innerHTML
end sub
The link appears to be "generated on the fly" by JAVA. If I hover over the link, in the bottom of IE, it will say "javascript: dataFrame.location.replace('deviceListHidden.do?device=2'); devViewFrame.location.replace('deviceview.do?device=2');"
If I click on this link, I go to the next page.
How would I click the link from VBA?
Here is the code from that frame:
Code:
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
 
<head>
   <title></title>
   <link rel='stylesheet' href='css/safariview.css' type='text/css'>
 
 
 
 
 
<script language="JavaScript1.2" src="deviceListVisible.js"></script>
<script language="JavaScript" src="showDOM.js"></script>
<script language="JavaScript" src="browserSniffer.js"></script>
 
<script language="JavaScript"> 
 
function handleOnLoad()
{
    parent.deviceListHiddenFrame.location = "deviceListHidden.do?device=";
}
 
</script>
 
 
</head>
 
<body class="body1" style="margin-top: 0px; margin-right: 9px;" onload="handleOnLoad(); if ( is_ie ) document.body.style.marginRight = '0px';">
 
<a class="blackLink" href="javascript: 
          var win = window.open(
            '/deviceListFrameSet.jsp?device=',
            'devices_tree2',
            '',
            false
          );
          win.resizeTo( 150, 600 );
       "><span class="label">Devices</span></a> &nbsp; <br>
 
 
<div id="mainContent" class="pageWidth pageHeight" style="height: 95%; overflow: auto; border-style: inset; border-width: 2px; background-color: #f7f7f7;">
<table id="outerTable" class="outerTable pageWidth pageHeight scrolling" style="border-width: 0px;">
 
<tr>
<td style="vertical-align: top;">
 
 
  <!-- device list table -->
 
 
<table id="devListTable"
  style="margin-left: 0px; margin-right: 0px; width: 100%; text-align: left;"
  border="0" cellpadding="5" cellspacing="5">
<tbody id="devListTBody">
 
 
 
 
</tbody>
</table>
 
</td></tr></table></div>
 
</body>
</html>
See attachment for the webpage.
Any help would be muchly appreciated!
Thanks!
Mc
Attached Files
File Type: zip SafariView [version 7_0_3_2 build 1].zip (95.4 KB, 5 views)
Reply With Quote
  #2  
Old 07-05-2010, 03:35 PM
Josh Hazel Josh Hazel is offline
Senior Contributor
 
Join Date: May 2008
Posts: 805
Default

Ive run into similar problems trying to work with JavaScript, it really makes things annoying to work with. Im hoping though if you find a solution you might share it here.
__________________
Josh

If Google = NoHelp Then PostHere = True
Reply With Quote
Reply

Tags
frames, internet explorer, java, vba


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->