General discussion

Locked

Hyperlink in Excel Viewed in Browser

By kennethaj ·
I have an excel spreadsheet workbook that users view on the web in their browser (Where the spreadsheet is actuall viewed in IE). This spreadsheet contains hyperlinks. Although most users simply save the spreadsheet to their hard drive, others tend to click on the link while viewing the workbook in the browser. The problem is that IE tries to open the link in the same browser window. This normally would not be a problem as long as no changes were made to the sheet (ex: resize a column). If there is a change, IE prompt you to either accept the change, reject the change, or cancel the action. What I need to do is have the link open in another IE window. The formula I use in the cells that contain the hyperlink is "=HYPERLINK("http://www.fedex.com/Tracking?tracknumbers="&A1&","&B1, Track Now)"). This command does not allow for any other parameters. The "hyperlink wizard" in excel does not support this type of formatting. Does anyone know any other way to make a hyperlink in an excel spreadsheet viewed in IE over the web open in another window rather than the current window. I wish that the excel hyperlinks supported HTML so I can use the "target="_blank" but it doesn't. I'll give 500 points to anyone that can make this work reliably.

This conversation is currently closed to new comments.

8 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

by senftk In reply to Hyperlink in Excel Viewed ...

I don't have a great answer for this one. Here is a link to some possible solutions using macros or VB.

http://www.experts-exchange.com/Applications/Q_21126612.html

Collapse -

by kennethaj In reply to
Collapse -

by ReWrite In reply to Hyperlink in Excel Viewed ...

You will need to create a macro and then link a button to the macro. Try this code for the macro:

Sub Link()
ActiveWorkbook.FollowHyperlink Address:= _
"http://www.google.com/", NewWindow:= _
False, AddHistory:=True
Application.WindowState = xlNormal
End Sub

Then create a button in the spreadsheet and link it to that macro. This should open a new window with the url specified (change www.google.com to your desired url).

Cheers.

RW

Collapse -

by kennethaj In reply to

Poster rated this answer.

Collapse -

by kennethaj In reply to Hyperlink in Excel Viewed ...

A apologize to everyone for not responding lately, I got tied up with projects at work. I'll through what works and award the points this weekend. thanks to everyone for helping out.

Collapse -

by mcspamlist In reply to Hyperlink in Excel Viewed ...

Set your Print Area and then...

'Save as nonstandard htm to c
Application.Goto Reference:="Print_Area"
With ActiveWorkbook.PublishObjects.Add(xlSourcePrintArea, _
"C:\index.htm", "Sheet1", "", _
xlHtmlStatic, "Testing Macro_17302", "")
.Publish (True)
.AutoRepublish = False
End With
' ADD <Base Target="_blank"> below body tag to open links in new windows
'open your file to get what is on the file in text form
Open "C:\index.htm" For Input As #1
'open your output file as a different file
Open "C:\Hello1.html" For Output As #2
'read information into a string variable to see the original
'loop the input
Do Until EOF(1)
Line Input #1, strInfo
intPosition = InStr(1, strInfo, "<body>", vbTextCompare)
If intPosition <> 0 Then
strNewInfo = strNewInfo & strInfo & "<base target=" & Chr$(147) & "_blank" & Chr$(14 & ">" & Chr(13)
Else
strNewInfo = strNewInfo & Chr(13) & strInfo
End If
Loop
'close the original document
Close #1
'output the information to the new file
Print #2, strNewInfo
'close the new file
Close #2
'replace the old file with the new file
FileCopy "C:\Hello1.html", "C:\index.htm"
'delete the new, maintain the original
Kill "C:\Hello1.html"

Collapse -

by kennethaj In reply to

Poster rated this answer.

Collapse -

by kennethaj In reply to Hyperlink in Excel Viewed ...

This question was closed by the author

Back to Software Forum
8 total posts (Page 1 of 1)  

Related Discussions

Related Forums