remerick
asked on
Using execScript to execute JavaScript in Web Browser
This question has come up before as recently as April 2004 and I have followed the thread in the title solution "JavaScript manipulation with VBA (Excel)" as an example. Unfortunately I am getting the same automation error that was showing up in the original posting and I can't seem to get around this. I don't know if it is related to scope of objects or the window I am trying to execute from, but here is a segment of the HTML/Script that I am trying to interact with:
<script language='JavaScript'>
var totalTimeoutMilliseconds = 2400000;
var warningTimeoutMilliseconds = 2160000;
var timeOutURL = 'http://xxx.xxx.xxx.com/psp/ps/EMPLOYEE/PSFT_EP/?cmd=expire';
var timeoutWarningPageURL = 'http://xxx.xxx.xxx.com/psc/ps/EMPLOYEE/PSFT_EP/s/WEBLIB_TIMEOUT.PT_TIMEOUT-WARNING.FieldFormula.IScript_TIMEOUTWARNING';
</script>
<link rel='stylesheet' type='text/css' href='/cs/ps/cache/PTSTYLE DEF_DARKBL UE_1.css' />
<title>ETC Analysis Start</title>
<script language='JavaScript'>
var baseKey_win0 = "";
var altKey_win0 = "05678\xbc\xbe\xbf\xde";
var ctrlKey_win0 = "JK";
var bTabOverTB_win0 = false;
var bTabOverPg_win0 = false;
var bTabOverNonPS_win0 = false;
</script>
<script language='javascript' src='/cs/ps/cache/PT_SCRIP TIE550_win 0_1.js'>
</script>
<SCRIPT LANGUAGE='JavaScript'>
document.domain = "xxx.xxx.xxx.com";
</SCRIPT>
<script language='javascript' src='/cs/ps/cache/PT_PAGES CRIPT_win0 _1.js'>
</script>
<script language='javascript' src='/cs/ps/cache/PT_ISCRO SSDOMAIN_w in0_1.js'>
</script>
<script language='javascript' src='/cs/ps/cache/PT_SAVEW ARNINGSCRI PT_win0_1. js'>
</script>
<script language='JavaScript'>
var nResubmit=0;
setupTimeout();
function submitAction_win0(form, name)
{
form.ICAction.value=name;
form.ICXPos.value=getScrol lX();
form.ICYPos.value=getScrol lY();
processing_win0(1,3000);
form.ICResubmit.value=nRes ubmit;
form.submit();
nResubmit++;
}
</script>
************************** ********** ********
And here is my VB code:
Dim IE As Object
Dim Wait As Integer
Dim test As String
Set IE = CreateObject("InternetExpl orer.appli cation")
IE.Navigate2 "http://xxx.xxx.xxx.com/psp/ps/EMPLOYEE/PSFT_EP/c/CREATE_PROJECTS.PC_XX_ETC_START.GBL"
While IE.busy
DoEvents
Wend
Call IE.Document.parentWindow.e xecScript( "submitAct ion_win0(d ocument.wi n0,'ETC_ST ART_WRK_PB _ADD');", "JavaScript")
************************** ********** ********** ****
When it gets to the execScript call, it generates an automation error # 80020101.
I also tried calling the execScript from the frame level (not sure if there even is a frame level. When try to identify the Document and parentWindow, I get back:
HTMLDocument
and
HTMLWindow2
prior to making the execScript call. It looks like they are referencing form win0 in the HTML, but I am not sure if that is affecting what I am trying to do.
Any help will be greatly appreciated! I am assigning 500 points due to urgency.
Bob
-
<script language='JavaScript'>
var totalTimeoutMilliseconds = 2400000;
var warningTimeoutMilliseconds
var timeOutURL = 'http://xxx.xxx.xxx.com/psp/ps/EMPLOYEE/PSFT_EP/?cmd=expire';
var timeoutWarningPageURL = 'http://xxx.xxx.xxx.com/psc/ps/EMPLOYEE/PSFT_EP/s/WEBLIB_TIMEOUT.PT_TIMEOUT-WARNING.FieldFormula.IScript_TIMEOUTWARNING';
</script>
<link rel='stylesheet' type='text/css' href='/cs/ps/cache/PTSTYLE
<title>ETC Analysis Start</title>
<script language='JavaScript'>
var baseKey_win0 = "";
var altKey_win0 = "05678\xbc\xbe\xbf\xde";
var ctrlKey_win0 = "JK";
var bTabOverTB_win0 = false;
var bTabOverPg_win0 = false;
var bTabOverNonPS_win0 = false;
</script>
<script language='javascript' src='/cs/ps/cache/PT_SCRIP
</script>
<SCRIPT LANGUAGE='JavaScript'>
document.domain = "xxx.xxx.xxx.com";
</SCRIPT>
<script language='javascript' src='/cs/ps/cache/PT_PAGES
</script>
<script language='javascript' src='/cs/ps/cache/PT_ISCRO
</script>
<script language='javascript' src='/cs/ps/cache/PT_SAVEW
</script>
<script language='JavaScript'>
var nResubmit=0;
setupTimeout();
function submitAction_win0(form, name)
{
form.ICAction.value=name;
form.ICXPos.value=getScrol
form.ICYPos.value=getScrol
processing_win0(1,3000);
form.ICResubmit.value=nRes
form.submit();
nResubmit++;
}
</script>
**************************
And here is my VB code:
Dim IE As Object
Dim Wait As Integer
Dim test As String
Set IE = CreateObject("InternetExpl
IE.Navigate2 "http://xxx.xxx.xxx.com/psp/ps/EMPLOYEE/PSFT_EP/c/CREATE_PROJECTS.PC_XX_ETC_START.GBL"
While IE.busy
DoEvents
Wend
Call IE.Document.parentWindow.e
**************************
When it gets to the execScript call, it generates an automation error # 80020101.
I also tried calling the execScript from the frame level (not sure if there even is a frame level. When try to identify the Document and parentWindow, I get back:
HTMLDocument
and
HTMLWindow2
prior to making the execScript call. It looks like they are referencing form win0 in the HTML, but I am not sure if that is affecting what I am trying to do.
Any help will be greatly appreciated! I am assigning 500 points due to urgency.
Bob
-
ASKER
>>Are you sure its from the correct frame?
Thanks for the feedback AzraSound. I am not certain that I am on the correct frame and not sure how to identify this. Any ideas on how to validate and specify where I am at the that time would be helpful.
>>Just to be sure, what if you move the code to call the script to a button or something, and click it when you know the document has fully loaded??
I am instantiating IE as part of the process. If you can tell me how to hook into an instance of an existing IE with the page already loaded, I can try out your suggestion.
Thanks,
Bob
Thanks for the feedback AzraSound. I am not certain that I am on the correct frame and not sure how to identify this. Any ideas on how to validate and specify where I am at the that time would be helpful.
>>Just to be sure, what if you move the code to call the script to a button or something, and click it when you know the document has fully loaded??
I am instantiating IE as part of the process. If you can tell me how to hook into an instance of an existing IE with the page already loaded, I can try out your suggestion.
Thanks,
Bob
>>Any ideas on how to validate and specify where I am at the that time would be helpful
We would need to see the html page source. If there are frames at all, would be the first question.
>>If you can tell me how to hook into an instance of an existing IE with the page already loaded, I can try out your suggestion.
What I meant was, instead of what you have above, do something like:
Dim IE As Object <~~ DECLARE AT TOP OF MODULE
Set IE = CreateObject("InternetExpl orer.appli cation")
IE.Navigate2 "http://xxx.xxx.xxx.com/psp/ps/EMPLOYEE/PSFT_EP/c/CREATE_PROJECTS.PC_XX_ETC_START.GBL"
Wait a minute...go to the restroom or grab some coffee (you get the idea) just to make sure the page has fully loaded. Then have a button on a form that says:
Private Sub Command1_Click()
Call IE.Document.parentWindow.e xecScript( "submitAct ion_win0(d ocument.wi n0,'ETC_ST ART_WRK_PB _ADD');", "JavaScript")
End Sub
BTW, do you ever make the browser visible, or is this all done with it hidden?
We would need to see the html page source. If there are frames at all, would be the first question.
>>If you can tell me how to hook into an instance of an existing IE with the page already loaded, I can try out your suggestion.
What I meant was, instead of what you have above, do something like:
Dim IE As Object <~~ DECLARE AT TOP OF MODULE
Set IE = CreateObject("InternetExpl
IE.Navigate2 "http://xxx.xxx.xxx.com/psp/ps/EMPLOYEE/PSFT_EP/c/CREATE_PROJECTS.PC_XX_ETC_START.GBL"
Wait a minute...go to the restroom or grab some coffee (you get the idea) just to make sure the page has fully loaded. Then have a button on a form that says:
Private Sub Command1_Click()
Call IE.Document.parentWindow.e
End Sub
BTW, do you ever make the browser visible, or is this all done with it hidden?
ASKER
I moved the code around so that the execScript fired after the page was loaded. Still get the same error.
Yes, I do make the browser visible also.
Thanks again!
Here is the entire source from the page:
<html lang='en'>
<!-- Copyright (c) 2000-2003 PeopleSoft, Inc. All Rights Reserved. -->
<!-- IE/5.5/WINNT; ToolsRel=8.43.10; Page=PC_XX_ETC_START; Component=PC_XX_ETC_START; Menu=CREATE_PROJECTS; User=111111; DB=PFTST/ORACLE; AppServ=//10.10.10.10:9000 ; -->
<head>
<script language='JavaScript'>
var totalTimeoutMilliseconds = 2400000;
var warningTimeoutMilliseconds = 2160000;
var timeOutURL = 'http://xxx.corp.xxx.com/psp/ps/EMPLOYEE/PSFT_EP/?cmd=expire';
var timeoutWarningPageURL = 'http://xxx.corp.xxx.com/psc/ps/EMPLOYEE/PSFT_EP/s/WEBLIB_TIMEOUT.PT_TIMEOUT-WARNING.FieldFormula.IScript_TIMEOUTWARNING';
</script>
<link rel='stylesheet' type='text/css' href='/cs/ps/cache/PTSTYLE DEF_DARKBL UE_1.css' />
<title>ETC Analysis Start</title>
<script language='JavaScript'>
var baseKey_win0 = "";
var altKey_win0 = "05678\xbc\xbe\xbf\xde";
var ctrlKey_win0 = "JK";
var bTabOverTB_win0 = false;
var bTabOverPg_win0 = false;
var bTabOverNonPS_win0 = false;
</script>
<script language='javascript' src='/cs/ps/cache/PT_SCRIP TIE550_win 0_1.js'>
</script>
<SCRIPT LANGUAGE='JavaScript'>
document.domain = "corp.xxx.com";
</SCRIPT>
<script language='javascript' src='/cs/ps/cache/PT_PAGES CRIPT_win0 _1.js'>
</script>
<script language='javascript' src='/cs/ps/cache/PT_ISCRO SSDOMAIN_w in0_1.js'>
</script>
<script language='javascript' src='/cs/ps/cache/PT_SAVEW ARNINGSCRI PT_win0_1. js'>
</script>
<script language='JavaScript'>
var nResubmit=0;
setupTimeout();
function submitAction_win0(form, name)
{
form.ICAction.value=name;
form.ICXPos.value=getScrol lX();
form.ICYPos.value=getScrol lY();
processing_win0(1,3000);
form.ICResubmit.value=nRes ubmit;
form.submit();
nResubmit++;
}
</script>
<script language='javascript' src='/cs/ps/cache/PT_EDITS CRIPT_win0 _1.js'>
</script>
</head>
<body class='PSPAGE' onload="
setFocus_win0('ETC_START_W RK_PB_ADD' ,-1);
setEventHandlers_win0('ICF irstAnchor _win0', 'ICLastAnchor_win0', false);
processing_win0(0,3000);
setKeyEventHandler_win0();
nResubmit=0;
">
<div id="WAIT_win0" style="position:absolute;r ight:0;dis play:block ;">
<img align='right' src='/cs/ps/cache/PT_PROCE SSING_1.gi f' class='PSPROCESSING' alt='Processing... please wait' />
</div>
<a name='ICFirstAnchor_win0'> </a>
<form name='win0' method='post' action="../../../EMPLOYEE/ PSFT_EP/c/ CREATE_PRO JECTS.PC_X X_ETC_STAR T.GBL" autocomplete='off'>
<input type='hidden' name='ICType' value='Panel' />
<input type='hidden' name='ICElementNum' value='0' />
<input type='hidden' name='ICStateNum' value='1' />
<input type='hidden' name='ICAction' value='None' />
<input type='hidden' name='ICXPos' value='0' />
<input type='hidden' name='ICYPos' value='0' />
<input type='hidden' name='ICFocus' value='' />
<input type='hidden' name='ICChanged' value='-1' />
<input type='hidden' name='ICResubmit' value='0' />
<table cols='3' width='100%' cellpadding='0' cellspacing='0' hspace='0' vspace='0'>
<tr>
<td width='80%'></td><td width='10%' nowrap='nowrap' align='right'></td>
<td width='10%' nowrap='nowrap' align='right'><a href="javascript:void window.open('http://xxx.corp.xxx.com/psp/ps_newwin/EMPLOYEE/PSFT_EP/c/CREATE_PROJECTS.PC_XX_ETC_START.GBL');" accesskey='9' tabindex='1' class='PSHYPERLINK'>New Window</a> |&nb sp; < a href="http://xxx.corp.xxx.com/PSOL/htmldoc/f1search.htm?ContextID=PC_XX_ETC_START&LangCD=ENG" target='help' tabindex='2' class='PSHYPERLINK'>Help</ a></td></t r>
</table>
<br />
<table border='0' cellpadding='0' cellspacing='0'>
<tr>
<td><img src='/cs/ps/cache/PT_TAB1L AX_1.gif' alt='' /></td>
<td><img src='/cs/ps/cache/PT_TAB1M AX_1.gif' width='100%' height='1' alt='' /></td>
<td><img src='/cs/ps/cache/PT_TAB1R AX_1.gif' alt='' /></td>
<td rowspan='2'></td>
</tr>
<tr>
<td><img src='/cs/ps/cache/PT_TAB2L AX4A598C_1 .gif' alt='' /></td>
<td nowrap='nowrap' align='center' class='PSACTIVETAB'> ETC Analysis </td>
<td><img src='/cs/ps/cache/PT_TAB2R AX4A598C_1 .gif' alt='' /></td>
</tr>
<tr>
<td><img src='/cs/ps/cache/PT_TAB3L AX4A598C_1 .gif' alt='' /></td>
<td class='PSACTIVETAB'></td>
<td><img src='/cs/ps/cache/PT_TAB3R AX4A598C_1 .gif' alt='' /></td>
<td><img src='/cs/ps/cache/PT_TB_BL N_1.gif' height='2' width='427' alt='' /></td>
</tr>
</table>
<table border='0' cellpadding='0' cellspacing='0' cols='7' width='569'>
<tr>
<td width='8' height='8'></td>
<td width='4'></td>
<td width='96'></td>
<td width='36'></td>
<td width='96'></td>
<td width='116'></td>
<td width='213'></td>
</tr>
<tr>
<td height='67'></td>
<td colspan='5' valign='top' align='LEFT'>
<span class='PSTEXT' >ETC Analysis</span>
</td>
</tr>
<tr>
<td height='54' colspan='2'></td>
<td colspan='2' nowrap='nowrap' valign='top' align='LEFT'>
<a name='ETC_START_WRK_PB_ADD ' id='ETC_START_WRK_PB_ADD' tabindex='14' href="javascript:submitAct ion_win0(d ocument.wi n0,'ETC_ST ART_WRK_PB _ADD');">< img src='/cs/ps/cache/PS_ADD_D OCUMENT_IC N_1.gif' name='ETC_START_WRK_PB_ADD $IMG' alt='Add' border='0' /></a>
</td>
<td colspan='3' nowrap='nowrap' valign='top' align='LEFT'>
<a name='ETC_START_WRK_PB_VIE W' id='ETC_START_WRK_PB_VIEW' tabindex='16' href="javascript:submitAct ion_win0(d ocument.wi n0,'ETC_ST ART_WRK_PB _VIEW');"> <img src='/cs/ps/cache/PS_REVIE W_DOCUMENT _ICN_1.gif ' name='ETC_START_WRK_PB_VIE W$IMG' alt='View' border='0' /></a>
</td>
</tr>
<tr>
<td height='19' colspan='2'></td>
<td colspan='2' nowrap='nowrap' valign='top' align='LEFT'>
<span class='PSHYPERLINK' >
<a name='ETC_START_WRK_PB_ADD $2$' id='ETC_START_WRK_PB_ADD$2 $' tabindex='15' href="javascript:submitAct ion_win0(d ocument.wi n0,'ETC_ST ART_WRK_PB _ADD$2$'); " class='PSHYPERLINK' title="Add" >Create/Update</a></span>
</td>
<td colspan='3' nowrap='nowrap' valign='top' align='LEFT'>
<span class='PSHYPERLINK' >
<a name='ETC_START_WRK_PB_VIE W$5$' id='ETC_START_WRK_PB_VIEW$ 5$' tabindex='17' href="javascript:submitAct ion_win0(d ocument.wi n0,'ETC_ST ART_WRK_PB _VIEW$5$') ;" class='PSHYPERLINK' >View</a></span>
</td>
</tr>
<tr>
<td height='182' colspan='2'></td>
<td valign='top' align='LEFT'>
<span class='PSTEXT' >Create/Update ETC Analysis data for further review or to submit.</span>
</td>
<td></td>
<td valign='top' align='LEFT'>
<span class='PSTEXT' >View previously submitted ETC Analysis sheets</span>
</td>
</tr>
</table>
</form>
<a name='ICLastAnchor_win0'>< /a>
</body>
</html>
Yes, I do make the browser visible also.
Thanks again!
Here is the entire source from the page:
<html lang='en'>
<!-- Copyright (c) 2000-2003 PeopleSoft, Inc. All Rights Reserved. -->
<!-- IE/5.5/WINNT; ToolsRel=8.43.10; Page=PC_XX_ETC_START; Component=PC_XX_ETC_START;
<head>
<script language='JavaScript'>
var totalTimeoutMilliseconds = 2400000;
var warningTimeoutMilliseconds
var timeOutURL = 'http://xxx.corp.xxx.com/psp/ps/EMPLOYEE/PSFT_EP/?cmd=expire';
var timeoutWarningPageURL = 'http://xxx.corp.xxx.com/psc/ps/EMPLOYEE/PSFT_EP/s/WEBLIB_TIMEOUT.PT_TIMEOUT-WARNING.FieldFormula.IScript_TIMEOUTWARNING';
</script>
<link rel='stylesheet' type='text/css' href='/cs/ps/cache/PTSTYLE
<title>ETC Analysis Start</title>
<script language='JavaScript'>
var baseKey_win0 = "";
var altKey_win0 = "05678\xbc\xbe\xbf\xde";
var ctrlKey_win0 = "JK";
var bTabOverTB_win0 = false;
var bTabOverPg_win0 = false;
var bTabOverNonPS_win0 = false;
</script>
<script language='javascript' src='/cs/ps/cache/PT_SCRIP
</script>
<SCRIPT LANGUAGE='JavaScript'>
document.domain = "corp.xxx.com";
</SCRIPT>
<script language='javascript' src='/cs/ps/cache/PT_PAGES
</script>
<script language='javascript' src='/cs/ps/cache/PT_ISCRO
</script>
<script language='javascript' src='/cs/ps/cache/PT_SAVEW
</script>
<script language='JavaScript'>
var nResubmit=0;
setupTimeout();
function submitAction_win0(form, name)
{
form.ICAction.value=name;
form.ICXPos.value=getScrol
form.ICYPos.value=getScrol
processing_win0(1,3000);
form.ICResubmit.value=nRes
form.submit();
nResubmit++;
}
</script>
<script language='javascript' src='/cs/ps/cache/PT_EDITS
</script>
</head>
<body class='PSPAGE' onload="
setFocus_win0('ETC_START_W
setEventHandlers_win0('ICF
processing_win0(0,3000);
setKeyEventHandler_win0();
nResubmit=0;
">
<div id="WAIT_win0" style="position:absolute;r
<img align='right' src='/cs/ps/cache/PT_PROCE
</div>
<a name='ICFirstAnchor_win0'>
<form name='win0' method='post' action="../../../EMPLOYEE/
<input type='hidden' name='ICType' value='Panel' />
<input type='hidden' name='ICElementNum' value='0' />
<input type='hidden' name='ICStateNum' value='1' />
<input type='hidden' name='ICAction' value='None' />
<input type='hidden' name='ICXPos' value='0' />
<input type='hidden' name='ICYPos' value='0' />
<input type='hidden' name='ICFocus' value='' />
<input type='hidden' name='ICChanged' value='-1' />
<input type='hidden' name='ICResubmit' value='0' />
<table cols='3' width='100%' cellpadding='0' cellspacing='0' hspace='0' vspace='0'>
<tr>
<td width='80%'></td><td width='10%' nowrap='nowrap' align='right'></td>
<td width='10%' nowrap='nowrap' align='right'><a href="javascript:void window.open('http://xxx.corp.xxx.com/psp/ps_newwin/EMPLOYEE/PSFT_EP/c/CREATE_PROJECTS.PC_XX_ETC_START.GBL');" accesskey='9' tabindex='1' class='PSHYPERLINK'>New Window</a> |&nb
</table>
<br />
<table border='0' cellpadding='0' cellspacing='0'>
<tr>
<td><img src='/cs/ps/cache/PT_TAB1L
<td><img src='/cs/ps/cache/PT_TAB1M
<td><img src='/cs/ps/cache/PT_TAB1R
<td rowspan='2'></td>
</tr>
<tr>
<td><img src='/cs/ps/cache/PT_TAB2L
<td nowrap='nowrap' align='center' class='PSACTIVETAB'>
<td><img src='/cs/ps/cache/PT_TAB2R
</tr>
<tr>
<td><img src='/cs/ps/cache/PT_TAB3L
<td class='PSACTIVETAB'></td>
<td><img src='/cs/ps/cache/PT_TAB3R
<td><img src='/cs/ps/cache/PT_TB_BL
</tr>
</table>
<table border='0' cellpadding='0' cellspacing='0' cols='7' width='569'>
<tr>
<td width='8' height='8'></td>
<td width='4'></td>
<td width='96'></td>
<td width='36'></td>
<td width='96'></td>
<td width='116'></td>
<td width='213'></td>
</tr>
<tr>
<td height='67'></td>
<td colspan='5' valign='top' align='LEFT'>
<span class='PSTEXT' >ETC Analysis</span>
</td>
</tr>
<tr>
<td height='54' colspan='2'></td>
<td colspan='2' nowrap='nowrap' valign='top' align='LEFT'>
<a name='ETC_START_WRK_PB_ADD
</td>
<td colspan='3' nowrap='nowrap' valign='top' align='LEFT'>
<a name='ETC_START_WRK_PB_VIE
</td>
</tr>
<tr>
<td height='19' colspan='2'></td>
<td colspan='2' nowrap='nowrap' valign='top' align='LEFT'>
<span class='PSHYPERLINK' >
<a name='ETC_START_WRK_PB_ADD
</td>
<td colspan='3' nowrap='nowrap' valign='top' align='LEFT'>
<span class='PSHYPERLINK' >
<a name='ETC_START_WRK_PB_VIE
</td>
</tr>
<tr>
<td height='182' colspan='2'></td>
<td valign='top' align='LEFT'>
<span class='PSTEXT' >Create/Update ETC Analysis data for further review or to submit.</span>
</td>
<td></td>
<td valign='top' align='LEFT'>
<span class='PSTEXT' >View previously submitted ETC Analysis sheets</span>
</td>
</tr>
</table>
</form>
<a name='ICLastAnchor_win0'><
</body>
</html>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
MsgBox IE.Document.frames.length
returns a count of 3.
returns a count of 3.
ASKER
I used :
Call IE.Document.Frames(2).exec Script("su bmitAction _win0(win0 ,'ETC_STAR T_WRK_PB_V IEW');", "JavaScript")
and it is working now. Thanks AzraSound! I will accept your answer.
Bob
Call IE.Document.Frames(2).exec
and it is working now. Thanks AzraSound! I will accept your answer.
Bob
Aha! So, this page source you posted is actually within one of these frames. Which one, we don't know, so give each a try:
Call IE.Document.frames(0).exec Script("su bmitAction _win0(docu ment.win0, 'ETC_START _WRK_PB_AD D');", "JavaScript")
Call IE.Document.frames(1).exec Script("su bmitAction _win0(docu ment.win0, 'ETC_START _WRK_PB_AD D');", "JavaScript")
Call IE.Document.frames(2).exec Script("su bmitAction _win0(docu ment.win0, 'ETC_START _WRK_PB_AD D');", "JavaScript")
Call IE.Document.frames(0).exec
Call IE.Document.frames(1).exec
Call IE.Document.frames(2).exec
I dont know if i am late. In any case let me post my findings
The reason is the document you are trying to download in still under process while your VB code passes the code.
modify your code to
"
Dim HTMLDoc as HTMLDocument
Set HTMLDOC=IE.Document
Loop Until HTMLDoc.readyState = "complete"
Call IE.Document.parentWindow.e xecScript( "submitAct ion_win0(d ocument.wi n0,'ETC_ST ART_WRK_PB _ADD');", "JavaScript")
"
Hope ot will help you
The reason is the document you are trying to download in still under process while your VB code passes the code.
modify your code to
"
Dim HTMLDoc as HTMLDocument
Set HTMLDOC=IE.Document
Loop Until HTMLDoc.readyState = "complete"
Call IE.Document.parentWindow.e
"
Hope ot will help you
Are you sure its from the correct frame?
Just to be sure, what if you move the code to call the script to a button or something, and click it when you know the document has fully loaded??