Announcement

Collapse
No announcement yet.

Open Hyperlinks Automatically in Excel into Google Chrome

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Open Hyperlinks Automatically in Excel into Google Chrome



    I need to check 2,000 hyperlinks in an Excel workbook so wanted to see if there is a way to open them automatically into Google Chrome (I wouldn't do all of them at once, probably batches of 50 or so). I tried the macro from this forum: http://forums.techguy.org/business-a...nce-excel.html which opened the hyperlinks in Internet Explorer (and massively crashed my computer into the bargain) so I was hoping there would be a way to open them in a different browser, ie Chrome.

    Thanks,

    Ben

  • #2
    Re: Open Hyperlinks Automatically in Excel into Google Chrome

    Unfortunately, you cannot automate Chrome using VBA as you can IE. Best you can do is something like
    Code:
    shell("C:\Users\USERNAME\AppData\Local\Google\Chrome\Application\Chrome.exe -url http:google.co.uk")   '// Or the address from your hyperlink

    You don't say what you want to do once the page is opened - so that's the general code above. There's not a lot more you can do with it, though.

    Comment


    • #3
      Re: Open Hyperlinks Automatically in Excel into Google Chrome

      Once the page is loaded I want to check prices and/or see if a product is out of stock (or indeed if it just gives a 404 error). How would I use that bit of VB you've mentioned to open lots of hyperlinks at once? I'm sorry if that's a bit of an amateur question...! Thanks for your response!

      Comment


      • #4
        Re: Open Hyperlinks Automatically in Excel into Google Chrome

        The code snippet I posted simply uses the standard Shell command to start a browser and navigate to a page. You cannot directly manipulate the data on that page, and, as I mentioned, you cannot automate Chrome with VBA - as far as I'm aware...

        You'll make your life a whole lot simpler if you use IE for this.

        Try this (as a sampler)
        Code:
        Public Sub Navtest()
        Dim ie as Object
         
        Set IE = CreateObject("InternetExplorer.Application")
        ie.visible = true
         
        Dim x as integer
        Dim links as Hyperlinks
        Set links = ActiveSheet.Hyperlinks
         
        For x = 1 to links.count
        ie.navigate links.item(x).address,nothing, "_blank"
        next
         
        End Sub
        Run it with the sheet containing the hyperlinks as the activesheet.

        Comment


        • #5
          Re: Open Hyperlinks Automatically in Excel into Google Chrome

          Plus...

          open lots of hyperlinks at once...
          is probably part of your problem. Don't open them all at once. Open one at a time, check, close it, move to next hyperlink and repeat...

          Comment


          • #6
            Re: Open Hyperlinks Automatically in Excel into Google Chrome

            You're right, using IE is much simpler, and your code didn't cause the cataclysmic death spiral for my computer that the other one did. Is there a way, though, to just open hyperlinks in the active selection rather than in the whole sheet that is open?

            Comment


            • #7
              Re: Open Hyperlinks Automatically in Excel into Google Chrome

              Change
              Code:
              ActiveSheet.Hyperlinks...
              to
              Code:
              Selection.Hyperlink...
              Last edited by cytop; September 5th, 2012, 04:21.

              Comment


              • #8


                Re: Open Hyperlinks Automatically in Excel into Google Chrome

                No, that's great, was able to do that minor edit myself... This has really helped, I'm very grateful, thank you very much...!

                Comment

                Working...
                X