First off, a history. A report generator I use is based in HTML. I get a series of 20-30 numbers for each report to be generated, and the method of generation is to open up Internet Explorer, login to a rudimentary user system, load up a simple local form, entering one number, hitting submit, waiting for the popup to say it has been processed, closing it, then moving onto the next.
Within Access, we have a database of these very numbers. What my plan originally was was to automate this process, having a macro setup in Access to generate the list, then open up Internet Explorer, login, input the number and submit automatically. I was fairly successful... mostly. I have managed to get the macro to generate the list, open IE, login, and navigate to the form.
Here's where I ran into a problem. Opening the page source for each page led me to the information I needed (form name, field names, etc.), and got me this far. However, the submission fields are a bit, well, peculiar. Unlike typical naming conventions such as "userid" or "login", the fields have arrays which I cannot find their association. Literally, the code in HTML reads:
typically, the code:
covers what I've needed. Forms("login") being the overall form holding the fields, and userid and password being the names of the fields. However, whenever I attempt to use such a line as "parameters[4].value" for the name, my knowledge of VB/VBA already prepared me for the inevitable error ahead. Is there a method of listing this field name in another fashion that VBA will accept? Or am I doomed to going to the original creator of the report generation software to finding the REAL form names? Or perhaps I'm going about this the wrong way, and there's a better way to automate this process?
Within Access, we have a database of these very numbers. What my plan originally was was to automate this process, having a macro setup in Access to generate the list, then open up Internet Explorer, login, input the number and submit automatically. I was fairly successful... mostly. I have managed to get the macro to generate the list, open IE, login, and navigate to the form.
Here's where I ran into a problem. Opening the page source for each page led me to the information I needed (form name, field names, etc.), and got me this far. However, the submission fields are a bit, well, peculiar. Unlike typical naming conventions such as "userid" or "login", the fields have arrays which I cannot find their association. Literally, the code in HTML reads:
Code:
<input type="hidden" name="parameters[4].name" value="number">
typically, the code:
Code:
With objIE
.Navigate "[URL unfurl="true"]http://url/login.html"[/URL]
Set objIE = CreateObject("InternetExplorer.Application")
With .Document.Forms("loginForm")
.userid.Value = "user"
.Password.Value = "password"
.submit
End With
End With
covers what I've needed. Forms("login") being the overall form holding the fields, and userid and password being the names of the fields. However, whenever I attempt to use such a line as "parameters[4].value" for the name, my knowledge of VB/VBA already prepared me for the inevitable error ahead. Is there a method of listing this field name in another fashion that VBA will accept? Or am I doomed to going to the original creator of the report generation software to finding the REAL form names? Or perhaps I'm going about this the wrong way, and there's a better way to automate this process?