none
Copy and paste web page in excel RRS feed

  • Question

  • Once you have reached a web page in MS edge using   

    CreateObject("Shell.Application").ShellExecute "microsoft-edge:https://finance.yahoo.com/

    how do you copy and paste it in Excel Spreadsheet?

    Saturday, July 13, 2019 7:16 PM

Answers

All replies

  • You can use SeleniumBasic to take screenshot and then paste it into Excel.  I'm using Chrome in this example because it is simpler.  Windows embeds edgedriver in Windows 10 so it is a convoluted process to start Edge and connect to instance in SeleniumBasic.  You'll need to update chromedriver to your version of Chrome.  This example just saves image.  There are 1000's of examples on web to insert image into Excel.

    Private Sub Take_ScreenShot_Content()
      Dim driver As New ChromeDriver
      driver.Get "https://finance.yahoo.com/"
      
      'take a screenshot of the page
      Dim img As Image
      Set img = driver.TakeScreenshot()
      
      'save the image in the folder of the workbook
      img.SaveAs "C:\temp\sc-content.png"
      
      driver.Quit
    End Sub
    

    Sunday, July 14, 2019 9:43 PM
  • Thanks for your answer. I will give it a try. 
    Monday, July 15, 2019 3:28 PM
  • Here are steps to update chromedriver.exe.  SeleniumBasic installs in C:\Users\ <user>\AppData\Local\SeleniumBasic.  Go to ChromeDriver - WebDriver for Chrome

    Download driver that matches your version of ChromeReplace driver

    Look at Excel examples.

    • Marked as answer by helloamerica Wednesday, July 17, 2019 11:51 AM
    Tuesday, July 16, 2019 10:21 PM
  • Thanks for your help.
    Wednesday, July 17, 2019 11:50 AM