Copilot for Microsoft 365 Tech Accelerator
Feb 28 2024 07:00 AM - Feb 29 2024 10:30 AM (PST)
Microsoft Tech Community
SOLVED

Open a website from within Excel

Brass Contributor

Hi,

In my Excel workbook I have a number of 'Command' buttons to run macros.

I also have one which I would like to (hopefully) click to access a website (which from outside Excel I access via google using the following:  https:/www.xxxx.xx.xx/api/v1 where xxxx is the website name), but I'm not sure that is possible. So my question is, is it possible to use a macro that could open this website from within my Excel workbook, allow me to use it, and then close it to get back to my Excel workbook when I've finished? If it is possible, can someone provide the code that would make this happen. I would be most grateful. If it is not possible, it would be good to know so I don't waste any more time trying to achieve this!!

3 Replies
best response confirmed by LesKing (Brass Contributor)
Solution

@LesKing 

Your macro can use the FollowHyperlink method of ActiveWorkbook to open a website in your default browser. But you'll have to go back to Excel yourself.

Thanks Hans,
You've got it spot on again!!
Thanks Hans,
You nailed it for me!
Thanks again, Les King
1 best response

Accepted Solutions
best response confirmed by LesKing (Brass Contributor)
Solution

@LesKing 

Your macro can use the FollowHyperlink method of ActiveWorkbook to open a website in your default browser. But you'll have to go back to Excel yourself.

View solution in original post