Navigate to URL without opening a browser

shoril

New Member
Joined
Nov 6, 2018
Messages
1
I need help with vba code to be directed to a URL without opening a browser. Having it pointed to the URL is sufficient to get me where I need to be.

"Followhyperlink" will navigate to the URL and open it in a browser. I just don't want a browser to open. I can use the URL in the background.

I hope this is explained well enough.
Thanks, Scott
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
Code:
Sub testing()
[COLOR="#FF0000"]'Requires references. Hit Alt+F11 | Tools | References | and check:
'Microsoft HTML Object Library
'Microsoft XML, v6.0[/COLOR]
Dim XMLPage As New MSXML2.XMLHTTP60
Dim htmlDoc As New MSHTML.HTMLDocument
Dim URL As String
    
    URL = "https://www.yourwebsite.com"
    XMLPage.Open "GET", URL, False
    XMLPage.send
    
    htmlDoc.body.innerHTML = XMLPage.responseText
	
	'Do something with the information
    debug.print htmlDoc.body.innerHTML
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,175
Members
453,021
Latest member
Justyna P

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