A macro for Word doc

Gy Rubio

Board Regular
Joined
Jan 29, 2009
Messages
50
I am trying to create a macro in Microsoft Word using a COMMAND BUTTON and not the "hyperlink" box

I typed in the following but not linking me to the site

do I have to change the ActiveWorkbook to something else


Private Sub CommandButton8_Click()
ActiveWorkbook.FollowHyperlink Address:="https://tamis.army.mil", _
NewWindow:=True
End Sub
 

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
It works as you have it if you put it all on one line. Just backspace the "NewWindow:=True" up to the same line as the rest.

Gary
 
Upvote 0

Forum statistics

Threads
1,225,385
Messages
6,184,646
Members
453,250
Latest member
unluckyuser

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