Two days of trying to solve this one and now I reach out for help!!!
In Access 2003, I have a module that auto logs into a website, then needs to navigate to a page that has 3 frames and 3 forms, set the select option of a field on the 2nd form of one frame, then submit, automatically. I have tried about a dozen variations of vba from web research and nothing works.
Always I get error "91 Object variable or with block variable not set".
The browser gets created fine, navigates from login page to new page fine.
HTML I am trying to control is in the second form:
<form name="pickReport" action="http://ees.elsevier.com/jpube/prepCustomReport.asp" method='post'>
<table>
<tr align='center'><td>Report:
<select name="rep" id="rep">
<option selected='selected' value="XX">Choose Report</option>
<option value='15'>Automated use</option>
<option value='14'>Full Data</option>
<option value='13'>Weekly Review Report</option>
</select><br />
</td></tr>
<tr><td> </td></tr>
<tr align='center'>
<td colspan='2'>
<input type="submit" name="submit" value="Run Report" /></td>
</tr>
</table>
</form>
With objIE.Document.Forms("pickReport")
.rep.Value = "15"
VBA follows, with some of the code I have tried, all commented out because they fail
With objIE.Document.Forms("pickReport")
'.Item("rep").Value = "15"
'.rep.Value = "15" ' this works when calling from local customreport.html but not from EES
' objIE.Document.getElementById("rep").Value = "15"
' .elements("rep").Value = "15" '"Automated use"
.submit
End With
Any help is greatly appreciated! Thank you!
Elaine
In Access 2003, I have a module that auto logs into a website, then needs to navigate to a page that has 3 frames and 3 forms, set the select option of a field on the 2nd form of one frame, then submit, automatically. I have tried about a dozen variations of vba from web research and nothing works.
Always I get error "91 Object variable or with block variable not set".
The browser gets created fine, navigates from login page to new page fine.
HTML I am trying to control is in the second form:
<form name="pickReport" action="http://ees.elsevier.com/jpube/prepCustomReport.asp" method='post'>
<table>
<tr align='center'><td>Report:
<select name="rep" id="rep">
<option selected='selected' value="XX">Choose Report</option>
<option value='15'>Automated use</option>
<option value='14'>Full Data</option>
<option value='13'>Weekly Review Report</option>
</select><br />
</td></tr>
<tr><td> </td></tr>
<tr align='center'>
<td colspan='2'>
<input type="submit" name="submit" value="Run Report" /></td>
</tr>
</table>
</form>
With objIE.Document.Forms("pickReport")
.rep.Value = "15"
VBA follows, with some of the code I have tried, all commented out because they fail
With objIE.Document.Forms("pickReport")
'.Item("rep").Value = "15"
'.rep.Value = "15" ' this works when calling from local customreport.html but not from EES
' objIE.Document.getElementById("rep").Value = "15"
' .elements("rep").Value = "15" '"Automated use"
.submit
End With
Any help is greatly appreciated! Thank you!
Elaine
Last edited: