title: MS Access Web Scraping -vba runtime error 91
body: <p>I have a small MS Access (Office 365) program to perform web page scrapes and store the results in Access tables.  The program looks up a web page then reads in any menu links.  However, when trying to do this I keep receiving the error:</p>
  <p>Object variable not set (Error 91)</p>
  <p>And this line gets highlighted:</p>
  <pre><code>Set arrAreas = vDiv.getElementsByClassName(&quot;rmLink rmRootLink&quot;)
  </code></pre>
  <p>This is the full code:</p>
  <pre><code>Private Function fx_Read_List()
      '------------&lt; fx_Read_List() &gt;------------
      
      '&lt; get Menu &gt;
      Dim vDiv As HTMLDivElement
      Set vDiv = hdoc.getElementById(&quot;ctl00_ctlMenu&quot;)
      
      '&lt; get Menu-Area Links &gt;
      Dim arrAreas As IHTMLElementCollection
      Set arrAreas = vDiv.getElementsByClassName(&quot;rmLink rmRootLink&quot;)
      '&lt;/ get Menu-Area Links &gt;
      
      '&lt; save in Array &gt;
      Dim arrLinks() As String
      ReDim arrLinks(100)
      Dim iLink As Integer
      For iLink = 0 To arrAreas.length - 1
          Dim aLink As HTMLAnchorElement
          Set aLink = arrAreas(iLink)
          arrLinks(iLink) = aLink.hRef
      Next
      ReDim Preserve arrLinks(iLink - 1)
      '&lt;/ save in Array &gt;
  </code></pre>
  <p>What am I missing?</p>