Linking to a specific sheet in HTML version of excel spreadsheet. ?

R

rband

Hi,

After I convert a excel spreadsheet to HTML, how do I hyperlink to a
specific sheet in the HTML doc. e.g. If the original excel doc has
sheets A, B, C. How do I hyperlink to shhet C in the HTML version ?

Thanks.
Robin
 
D

David McRitchie

I presume you are converting with Excel since you are seeing
sheets in your HTML. You would have to use the object kind
of hyperlinks in your Excel to begin with.
Ctrl+K
on the left choose, "place in this document"
type in C!H14
or use the tree structure to choose sheet, and type in H14
--
 
R

rband

Actually, my question was regarding a http link from an external web
page to a specific sheet within an excel file.
I found an answer to this in the Microsoft knowledge base:
http://support.microsoft.com/default.aspx?scid=kb;en-us;197922

The link format is something like:
http://localhost/example.xls#SheetName!A1"

So this works fine when linking to the original excel file.
What I really want to do is convert the original excel file to html,
and then
link to a specific sheet within that html file. Not sure how to do
that.
Links in the bave format dont seem to work for this ..

Thanks.
Robin
 
D

David McRitchie

Hi Robin,
Let's start with something everybody with Excel 2000 up
can work with.

Create a new workbook and save it
I named mine 2004-08-05-Robin.xls
(My default file location is C:\bk1\h\excel2k )

Ctrl+A, apply borders to all cells with toolbar button
or with Format, Cell, Borders, inside borders & outside borders
Apply borders also to sheet3

Rename 'Sheet3' to 'Other Sheet3'
that puts a space into the worksheet name for a
more complete example.

Into cell C4 enter 'C4-1
Into cell B50 enter 'B50-1
Return to Sheet1

Select C5 place = in cell then select C4 on 'Other Sheet3'
return to sheet1
Ctrl+K, then
Select C6 place = in cell then select B50 on "Other Sheet3'
return to sheet1

File, Save As
save entire workbook (checked)
2004-08-05-Robin.htm
save as type: Web page *.htm, *.html
Save

Go to the directory where you have your workbook and HTML file
Click on 2004-08-05-Robin.htm

You will also notice that Excel creates an HTML file (11 KB) and
a folder (43.3 KB) with the same name, you need everything on
your website. If I created them myself sheet1 woulb be 2 KB
and the other sheet 5 KB, and I would have had to code out
the HREF myself, but it does show you show the cost of making
HTML look exactly like Excel and have round tripping.

You will see that the hyperlink used here is a bit different
than if you created the HTML yourself without the clickable
sheet tabs.

file:///C:/bk1/h/excel2k/2004-08-05-Robin_files/sheet003.htm#RANGE!C4
file:///C:/bk1/h/excel2k/2004-08-05-Robin_files/sheet003.htm#RANGE!B50
file:///C:/bk1/h/excel2k/2004-08-05-Robin_files/sheet001.htm#'Other Sheet3'!D5

But in answer to your question, perhaps it might have sufficed
to say that you create the hyperlinks as object hyperlinks
within Excel *before* converting to HTML.

The HYPERLINK Worksheet Function will not work when
converted to HTML. I actually include this in the above
example: in cell A8 just to see what would actually happen:
=HYPERLINK("#'Other Sheet3'!D5","see Other Sheet3 cell D5")

Actually it comes closer than I would have expected so
it just might be possible in a later version of Excel
(mine is Excel 2000), for instance in Excel 2002 and up
the following is valid
=HYPERLINK('Other Sheet3'!D5,"see Other Sheet3 cell D5")
so you might try that and let me know what happens,
I doubt that it would generate HTML that works on a website.
a different method of specifying the link portion.
 
D

David McRitchie

Correcting the entry of hyperlinks inline


David McRitchie said:
Hi Robin,
Let's start with something everybody with Excel 2000 up
can work with.

Create a new workbook and save it
I named mine 2004-08-05-Robin.xls
(My default file location is C:\bk1\h\excel2k )

Ctrl+A, apply borders to all cells with toolbar button
or with Format, Cell, Borders, inside borders & outside borders
Apply borders also to sheet3

Rename 'Sheet3' to 'Other Sheet3'
that puts a space into the worksheet name for a
more complete example.

Into cell C4 enter 'C4-1
Into cell B50 enter 'B50-1
Return to Sheet1

Select C5 place = in cell then select C4 on 'Other Sheet3'
return to sheet1
Into cell C4 enter 'C4-1
Into cell B50 enter 'B50-1
Return to Sheet1

Select C5 place = in cell then select C4 on 'Other Sheet3'
return to sheet1
Ctrl+K (edit hyperlink)
Place in this document (on left)
Other Sheet 3 -- the name of the sheet on rightside
C4
Select C6 place = in cell then select B50 on "Other Sheet3'
return to sheet1

Ctrl+K (edit hyperlink)
Place in this document (on left)
Other Sheet 3 -- the name of the sheet on rightside
B50
File, Save As
save entire workbook (checked)
save entire workbook (checked)
2004-08-05-Robin.htm
save as type: Web page *.htm, *.html
Save

Go to the directory where you have your workbook and HTML file
Click on 2004-08-05-Robin.htm

You will also notice that Excel creates an HTML file (11 KB) and
a folder (43.3 KB) with the same name, you need everything on
your website. [clipped]


But in answer to your question, perhaps it might have sufficed
to say that you create the hyperlinks as object hyperlinks
within Excel *before* converting to HTML.

[clipped]
 

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