2

I have a ms excel 2007 worksheet with a column (A) of hyperlinks using the excel function in this way =HYPERLINK(A2,"url".

How Can I make (if this is possible) open all cels on that column in the NON default browser?

1
  • Short answer is no you cannot May 23, 2016 at 17:47

2 Answers 2

2

If you enter the path of the browser with the exe file and put the URL after, it will open using that browser.

For example

"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" http://superuser.com/questions/1079979/how-can-i-make-an-excel-column-of-hyperlinks-open-in-non-default-browser

Unfortunately you can not use this in Excels Hyperlink function, so we need a workaround.

One solution would be, to create a batch file and set the hyperlink to run that batch file. All you need to do is copy the code into a text file, and save it as .bat


Another solution is using VBA.
Press alt + F11, and paste the following code into "ThisWorkbook".

Private Sub Workbook_SheetFollowHyperlink(ByVal Sh As Object, ByVal Target As Hyperlink)

If Target.Name = "asd" Then 'Or you can identify a cell using it's range instead of its name If Target.Range.Address = "$A$1" Then

Shell ("C:\Program Files (x86)\Google\Chrome\Application\chrome.exe http://superuser.com/questions/1079979/how-can-i-make-an-excel-column-of-hyperlinks-open-in-non-default-browser")
End If

End Sub

Than you have to make a hyperlink out of the cell by right click, hyperlink, select place in this document, than ok.

1

This question is a little old but it is referenced in a newer, similar question so I am adding an updated answer. In my example my spreadsheet has three columns, DATE, URL, OTHER_INFO and the URL column has the links.

With the excellent ImportExcel module this becomes pretty easy. From the module, use the Import-Excel cmdlet to read the spreadsheet into a variable and then use a foreach loop to open each link:

$excel = Import-Excel -Path "C:\Users\UserName\Desktop\Temp\test.xlsx"
$brows = "C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe"
foreach ($url in $excel.URL){
    Start-Process -FilePath $brows -ArgumentList $url
    #    Write-Host $brows $url  ## TEST
    }

Start-Process -FilePath $brows -ArgumentList $url

This opens each link in a new tab in Edge.

If you are unable to use the ImportExcel module, it is more verbose but you can still access spreadsheet data using the COM objects

1
  • Please do not post the same answer to multiple questions. If the same information really answers both questions, then one question (usually the newer one) should be closed as a duplicate of the other. You can indicate this by voting to close it as a duplicate or, if you don't have enough reputation for that, raise a flag to indicate that it's a duplicate. Otherwise tailor your answer to this question and don't just paste the same answer in multiple places.
    – DavidPostill
    Jul 27, 2022 at 5:56

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .