title: Javascript Injection in Chrome with Excel VBA
body: <p>I am trying to inject a search criteria or log-in or whatever into a Chrome window using VBA. In IE this exercise isn't difficult since IE is the top level object in the DOM. Totally confused using a shell function in VBA what the document object model looks like at the top to access the open window. Here is my example code</p>
  
  <pre><code>Function sparkroomInChrome()
  
    Dim chromePath As String
  
    chromePath = """C:\Program Files (x86)\Google\Chrome\Application\chrome.exe"""
  
    Shell (chromePath &amp; " -url https://google.com
  
  End Function
  
  Function userCredentials()
  
       document.getElementsByClassName("gsfi")[0].value = "cats";
  
  End Function
  </code></pre>
  
  <p>Any guidance would be super appreciated on this or any insight for other similar solutions. Thank you.</p>