8

A bunch of our network/server/storage hardware uses web interfaces for their administrative portals. I'm currently using an Excel 2010 worksheet to keep track of each device. I have one column set aside to list the URL for each web interface. This makes it easy to simply click the URL to open each administrative portal.

My default browser is Firefox. However, some of the administrative portals don't play well with Firefox and require the use of IE. Until now, when I want to open a hyperlink in IE, I have to manually open IE, copy the URL from the Excel worksheet, and paste it into the IE address bar (otherwise it will open in Firefox if I simply click it). It's just an annoying extra couple of steps.

So without changing Firefox as my default browser, is there a simple way in Excel 2010 to tell it which hyperlinks to open in IE when they are clicked? I want to choose specifically which links open in which browser

(For reference I'm using Windows 7 Enterprise 64-bit)

ᔕᖺᘎᕊ
  • 6,393
RSW
  • 1,006

7 Answers7

2

Short answer, no. Excel has no option to open an url with another program than specified by the system as default.

Excel will threat an url by simply doing: Start url (aka using DDE extension to open the url with whatever is set as default program).

Using a VB Macro, you can however create a custom link that'll launch the link with IE.

It will require a bit of programming and is not easy, and you may have to edit all cells and remove the hyperlink and save the link as text alone in that box for it to work properly.

Although SuperUser is not a scripting site (and a new question specifically for programming should be asked at StackOverflow if you're going to do it that way), you'd be trying to do it as follows.

Launch a macro everytime any cell is clicked (function Sheet1_clicked()) I believe is the event. Then break out of the function if the column is not the column you have your urls in, or alternatively, if the cell does not start with #URL:. You can even check if the next column has this value, so you can effectively hide that column, and make the column before it the event clicking one. You can use a conditional forward to check if the next cell has any text, and if so using colors, show a "click me" text.

Now, in the script itself, you'd program to launch IExplore.exe with the url.

LPChip
  • 66,193
1

The best way I have found to do this is by creating a link to a Batch File... to create a Batch file, create a text document by RIGHT Click on the desktop or in a folder you want to store the link in, and select >New >Text Document.

Rename the document to something you will remember like Yahoo_Mail.BAT (file name extensions must be turned on or you wont be able to change the extension)

Now right click on the newly created Yahoo_Mail.BAT and choose Edit

To start in Chrome, type: START CHROME.EXE mail.yahoo.com

Now, In Excel, Create your link to point to that file, and it will open the web page, just as if you entered it into a dos command line window. Just remember, if you email someone the Excel document, you must give them the batch file and thell them what folder to put it in on their laptop so the link will work...I use this mostly for personal excel files that I am not emailing to people, but either way it is an easier way that avoids having to program it into excel. If you want to use Explorer, just substitute your browser executable in the above examble (use iexplore.exe for internet explorer) GOOD LUCK! I hope this helps somebody, it really messed with me for a while. I thought I should be able to run the command from the hyperlink tab in excel, that just uses the default browser...

Sometimes, you just want to use another browser to open your links...LOL! I like to use chrome myself for some things, but don't want my main home PC using chrome as a default because of other stuff I do.

1
  1. Create an empty link in the cell that follows to that cell (if you create a hyperlink with real address, the Excel will open default browser and your specific browser both).

  2. In a sheet that contains your "hyperlink" add VBA code like this (update the path to your browser application before):

Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink)

Shell """" & Environ$("USERPROFILE") & "\AppData\Local\Google\Chrome\Application\chrome.exe"" ""https://superuser.com"""

End Sub

not2qubit
  • 2,651
  • 4
  • 34
  • 45
Alekzander
  • 131
  • 3
0

I know this is an older post, but I just came across it. Hopefully this gives someone some ideas...

It might depend on how many portals you have, but you could make a button for each one. That is, create a shape, give it some style and some text (be creative, those little grey default buttons are ugly). I store a template shape off to the side (in column TTT, for example), and use the Name Box to quickly jump to it. Each time I need a new button, I change the text, snip it, ctrl+Home to my dashboard area, paste, and line it up with the rest. If you right click on a shape in excel, you can assign a macro. That will prevent the need to have a separate event trigger (which can cause a lot of clocking every time you click around).

I won't go into all the coding, but the "Shell" command in VBA allows you to launch chrome (and other applications). Just define 2 string variables, one for the URL and one for the program location (this second one could be a public function so you don't have to keep coding it). This takes a little time to setup the first button and first bit of code, but after that it's mostly copy & paste.

One tip if you go this route, In order to attach a macro to a shape (turning it into a button), it must be visible. This can overload your macro list quickly. So, after it's attached to the shape, change the macro to a "Private Sub" to keep things tidy.

I have a "Launcher" built into my personal.xlsb with somewhere around 50 buttons (along with a timer I built and a notes section). The whole thing took me a week to setup, a little at a time, as the workflow came up. In the end, it saves me from having to interact with the file/folder system, and opens all required documents/URLs/programs needed for a specific task. Saves TONS of time (clicks) & keeps me organized, totally worth it (and if you send it to someone, everything still works).

NJPapa
  • 1
0

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

DBADon
  • 503
0

I finally found a good solution to this problem:

Re:Link is a program that is set as your default browser. Any links clicked in Windows go to Re:Link and then are opened in the correct browser. You can specify URLs with certain keywords to open in IE or Edge and the rest to open in Firefox or Chrome, for instance.

https://relink.shameel.net/

  1. User clicks on link inside apps or Email client or enters a URL in the Run dialog
  2. The operating system (Windows/Mac) sends the link to the default browser (Re:Link)
  3. Re:Links resolves the link to a browser based on Rules
  4. Re:Link opens the link using the resolved browser or the Fallback browser if link resolution fails.
jjz
  • 462
-1

Create a shortcut named named Device on the desktop to: "%programfiles%\internetexplorer\explore.exe" http:\(webaddres) I have a folder named Scripts that I set in C: for all my batch files etc. Copy the shortcut to yours C:/Scripts folder and have the hyperlink in Excel point to the C:/Scripts/Device.lnk