run report on web page, import to excel
one you get past the 'select report' thing you might get similar
compile error on the date selection, if so - try replacing that one
lblInitiateDt
with
txtInitiateDtFrom
It seems that your web developer used the 'lbl' to specify LABELS and
TXT to specify text fields and SEL to specify select fields (which
makes sense) - error in my initial code was that i was trying to set a
value of a label (lblSe...) which can't be done. The same applies to
the date field - i was trying to set a value to lblIn... (a label) -
therefore try the txtInitiateDtFrom.
The same might apply to the DateTo (tha'ts not in my code at all yet)
- for that one the id seems to be:
txtInitiateDtTo
AB.
On Mar 25, 4:51*pm, AB wrote:
It means that it's unable to get the lblSelectReport element from the
HTML.
Try replacing it (lblSelectReport) with:
selSavedReports
It's that i'm trying to guess which element exactly from the HTML
holds the valu of the report you want to run. Without having access to
the exact working website it's almost hit&miss.
Also, depending on the design of the web page it might not be yet
loaded before the vba tries to grab the element (i.e., this
* * * * 'wait until IE finished loading the page
* * * * Do Until Not ie.Busy And ie.ReadyState = 4
* * * * * * DoEvents
* * * * Loop
might still not determine precisely if the web page has actually
loaded completely.
To check this put 'Stop' before this
*Set varHtml = ie.Document
in the vba code, so it would look something like this:
.....
* * End With
* * Stop ' This will halt your vba code here so that you could
manually chekc if the Internet Explorer actually _
* * * * * * *has loaded completely. Then to proceed hit either F5 to
run the whole code or F8 to step it through step by step.
* * Set varHtml = ie.Document
* * With varHtml
........
On Mar 25, 4:12*pm, MartinL wrote:
Yes I found the "Microsoft Browser Helper" and now it compiles correctly.
But now I am getting this error: "Object variable or With block variable not
set (Error 91)" upon executing: .getElementById("lblSelectReport").Value = 762
Do you know what this may be? . . .- Hide quoted text -
- Show quoted text -
|