title: VBA - Opening a website and saving it as a .GIF extension
body: <p>I am trying to open and then save a web page which contains an image as a .GIF extension to my desktop. The below code opens a test page for me:</p>
  
  <pre><code>Sub test()
      Dim IE As Object, Doc As Object
      Set IE = CreateObject("internetexplorer.application")
      IE.Visible = True
      IE.Navigate "http://www.orseu-concours.com/54-189-thickbox/epso-numerical-reasoning-test-2-en.jpg"
  
      Do While IE.ReadyState &lt;&gt; 4: DoEvents: Loop
      Set Doc = CreateObject("htmlfile")
      Set Doc = IE.Document
  End Sub
  </code></pre>
  
  <p>The next step is saving the page as a .GIF. The manual process for doing this is either right clicking the image and pressing save and then adding the .gif extension to the name or another way is to just press CTRL+S on the page and save it as an image that way.</p>
  
  <p>I have tried API function <strong>URLDownloadToFile</strong> however the image I am using for my application updates every time the page is refreshed and I require the saved image to be the same as the one open therefore, cannot use the above function as it results in the two different images.</p>
  
  <p>If possible, I am trying to avoid using SendKeys for this.</p>