Javascript Hyperlink in OWC11 spreadsheet

N

Nhut Minh Tran

I'm working on a web application for my company, and part of it includes a
OWC spreadsheet. In the cells in one column, I want to add a hyperlink that,
when clicked, calls a javascript function. Therefore, in the Office XMl, Id
do the following:

<ss:Cell ss:HRef="javascript:alert('Link to javascript');">;
<ss:Data ss:Type="String">Launch Documents</ss:Data>
</ss:Cell>

However, when I click on it, IE complains that it is "Unable to navigate to
javascript:javascript:alert('Link to javascript');"

Any ideas if what I'm trying to do is possible, and how I might do it?
 
A

Alvin Bruney [MVP]

The hyperlink parameter takes a hyperlink, it doesn't allow for script
execution. You may want to catch the click event, and fire some client scrip
before navigating to the web page. Have a look at the eventing model for the
OWC.

--
________________________
Warm regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
Professional VSTO.NET - Wrox/Wiley
The O.W.C. Black Book with .NET
www.lulu.com/owc, Amazon
Blog: http://www.msmvps.com/blogs/alvin
 
N

Nhut Minh Tran

Many thanks for your advice. I have written a 'Click' event script. It is OK,
but I have no way to change cursor to 'hand' style when mouse is over a cell.
Please help me.

Alvin Bruney said:
The hyperlink parameter takes a hyperlink, it doesn't allow for script
execution. You may want to catch the click event, and fire some client scrip
before navigating to the web page. Have a look at the eventing model for the
OWC.

--
________________________
Warm regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
Professional VSTO.NET - Wrox/Wiley
The O.W.C. Black Book with .NET
www.lulu.com/owc, Amazon
Blog: http://www.msmvps.com/blogs/alvin
-------------------------------------------------------


Nhut Minh Tran said:
I'm working on a web application for my company, and part of it includes a
OWC spreadsheet. In the cells in one column, I want to add a hyperlink
that,
when clicked, calls a javascript function. Therefore, in the Office XMl,
Id
do the following:

<ss:Cell ss:HRef="javascript:alert('Link to javascript');">;
<ss:Data ss:Type="String">Launch Documents</ss:Data>
</ss:Cell>

However, when I click on it, IE complains that it is "Unable to navigate
to
javascript:javascript:alert('Link to javascript');"

Any ideas if what I'm trying to do is possible, and how I might do it?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top