Hyperlink in new window

soonenuff

New Member
Joined
Feb 4, 2009
Messages
1
Hi,
I am trying to run an excel workbook (with 7 sheets) via a webbrowser. Users have to enable macros to run three particular sheets on this workbook. There's a button on these sheets that hyperlinks to a document on a website via this code:

Private Sub combtn_rule_14_whole_Click()

Application.DisplayAlerts = False
On Error Resume Next
ActiveWorkbook.FollowHyperlink
Address:="http://www.pge.com/tariffs/pdf/GR14.pdf", _
NewWindow:=True
Application.DisplayAlerts = True

End Sub

However, when users click on this link, it produces an a "display alert" error. To fix this, I commented out the display alerts, so the code looks like this:

Private Sub combtn_rule_14_whole_Click()

On Error Resume Next
ActiveWorkbook.FollowHyperlink
Address:="http://www.pge.com/tariffs/pdf/GR14.pdf", _
NewWindow:=True

End Sub

When users click on the button now, there is no action that takes place.
I try using a different method: instead of using the button, I placed a hyperlink right in the cell. The link work. However, it uses the same browser. User have to use the back button. What can I do to either fix the first scenario with the button? If not, how can I get the link to open up in a new window. Thanks.
Mark
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes

Forum statistics

Threads
1,223,405
Messages
6,171,925
Members
452,433
Latest member
Woodchuck76

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