Thank you in advance for any assistance that can be offered. I am trying to activate a link with Excel VBA to change the view of the data presented by a dashboard. I have managed to perform the login and navigation process and believe that the scraping element will run smoothly after this step. I don't believe that I am targeting the right elements or am not structuring the VBA sequence correctly.
I am attempting to trigger the 'consultant view' within the HTML below:
<div style="width:100%; clear:both">
<ul class="tab_menu clearfix" style="padding-top:5px;">
<li id="site_ti" class="table_tab_item">
<a href="#" onclick="update_table_tab('site'); return false;">By Site</a>
</li>
<li id="director_ti" class="table_tab_item">
<a href="#" onclick="update_table_tab('director'); return false;">By Director</a>
</li>
<li id="team_lead_ti" class="table_tab_item">
<a href="#" onclick="update_table_tab('team_lead'); return false;">By Team Manager</a>
</li>
<li id="consultant_ti" class="table_tab_item">
<a href="#" onclick="update_table_tab('consultant'); return false;">By Consultant</a>
</li>
</ul>
I have thusfar used the following routines with no result:
These are the declarations at the beginning of the Public Sub:
Public Sub Huddle_Report_Scrape(ObjIE)
Dim ie As SHDocVw.InternetExplorer
Dim doc As MSHTML.HTMLDocument 'If you have a reference to the HTML Object Library
Dim objShell, obj, objInputs, objButtons As Object
Dim htmldoc As MSHTML.IHTMLDocument 'Document object
Dim tbl As MSHTML.IHTMLElementCollection
Dim eleColtr As MSHTML.IHTMLElementCollection 'Element collection for tr tags
Dim eleColtd As MSHTML.IHTMLElementCollection 'Element collection for td tags
Dim eleRow As MSHTML.IHTMLElement 'Row elements
Dim eleCol As MSHTML.IHTMLElement 'Column elements
Dim Table As MSHTML.HTMLTable
Dim row As MSHTML.HTMLTableRow
Dim cell As MSHTML.HTMLTableCell
Dim col As MSHTML.HTMLTableCol
Below is the function I am calling to trigger the consultant view.
Function FnConsultantView(ObjPage)
With ObjPage
Set li = .getElementByValue("consultant")
With li
.Focus
.FireEvent "onclick"
End With
End With
MsgBox ("Operation Completed")
I have also attempted to use elements from the following post without much luck: FireEvent and IE11