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

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.

Forum statistics

Threads
1,215,343
Messages
6,124,402
Members
449,156
Latest member
LSchleppi

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