Open a URL without redirecting

Chauffo

New Member
Joined
Jan 6, 2017
Messages
2
Hi,

I'm a long time reader but first time poster. I've spent a long time googling and am hoping someone can help me.

My problem:

I want to open a specific URL from Excel. The issue is that the URL needs to be opened exactly - I'm using a specific gmail URL string which won't work if it's redirected. Currently the correct page will open if manually copied into the browser, but not if accessed within Excel...

Things I've tried:

I've tried using a hyperlink but Excel forces a redirect, maybe because Excel is prefacing the URL with a byte order mark which is causing the browser to incorrectly assume the connection is insecure.

I've also tried some of the standard VBA:

Code:
ThisWorkbook.FollowHyperlink (URL)
Code:
Process.Start URL
and variants of
Code:
.Navigate URL

But they all suffer from the same.

Is there a way I can write over the current URL in a webpage using VBA? That way I could open a standard browser tab (e.g. "https://google.com") and then paste the specific URL I need into the address bar.

Failing that, is there any way I can force Excel to use the listed URL rather than redirecting WITHOUT having to add any internet registry values e.g. ForceShellExecute, e.g. by using the WinHttp COM object?

Any help very much ​appreciated!
 
Try calling OpenIE(URL) instead of ThisWorkbook.FollowHyperlink(URL), like this:
Rich (BB code):
Sub Test()
  Const URL = "http://www.mrexcel.com/forum/excel-questions/984197-open-url-without-redirecting.html"
  OpenIE URL
End Sub
 
Sub OpenIE(URL)
  With CreateObject("InternetExplorer.Application")
    .Visible = True
    .Navigate URL
  End With
End Sub
 
Last edited:
Upvote 0

Forum statistics

Threads
1,226,875
Messages
6,193,455
Members
453,801
Latest member
777nycole

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top