2

I would like to insert code to launch a default browser in a new SMALL window from within my Excel spreadsheet. Has anyone done this before?

I can already launch my default browser using a SHELL and/or FollowHyperLink statement but I need my Excel spreadsheet to remain in focus. If possible I'd like to add it to my existing browser call:

ThisWorkbook.FollowHyperLink("h.......")

User15
  • 294
  • 1
  • 14
wifinut
  • 21
  • 2
  • 1
    Why does yout Workbook need to stay in focus? If you use a selection, have a look at [this](http://stackoverflow.com/questions/10714251/how-to-avoid-using-select-in-excel-vba-macros). You also could reactivate your Workbook via `.Activate`-command. – Verzweifler Aug 11 '15 at 08:06
  • You could try putting a IE object on a form? – 99moorem Aug 11 '15 at 08:25

1 Answers1

0

You can use a WebBrowser control. This may need to be added to the ActiveX controls. Go to Developer Tab > Insert > More Controls > Microsoft Web Browser.

Add more controls to ActiveX

To control the WebBrowser, use the .Navigate2 (string) command

strWebsite = "www.google.com"
Sheet1.WebBrowser1.Navigate2 (strWebsite)
Dan
  • 409
  • 3
  • 9
  • Thanks. I neglected to mention that launching the browser is one of many tasks that designed around the button that launches the browser. Basically its structured as follows: Private Sub Commandbutton1() do stuff ...then launch the website.. – wifinut Aug 11 '15 at 17:56