convert workbook to html

E

eugene

Hi,

I have a large file, many sheets, with many hyperlinks (to cells within the
workbook and to cells in other workbooks). I have tried converting these to
HTML using Excel's converter and a shareware program. Neither does what I
want. The main problem is that the hyperlinks end up refering to things that
are not useful. Is there any way to get better control over the pages and
hyperlinks that are generated?

Eugene
 
A

Aran Black

Eugene,

I have just created the following VBA code for inserting hyperlinks:
Inserting cell references to other sheets and workbooks is not actually a
"hyperlink". It is only a "reference" to another Excel file location.
What do you mean when you say you have "converted these to HTML"?
Are you referring to the sheets, workbooks, or links
("Reference"/"hyperlink") in the cells?

Aran

Sub insertinglinks()
'
' insertinglinks Macro
' Macro recorded 02/11/2007 by ablack

ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:= _
"http://www.aranblack.co.uk",
TextToDisplay:="http://www.aranblack.co.uk"

End Sub
 
E

eugene

Aran,

Thanks for the response. But it's not what I need.
What do you mean when you say you have "converted these to HTML"?
I am trying to create HTML documents from my Excel spreadsheets, using
Excel's "Save As Web Page." Does a terrible job on the hyperlinks.

Any other suggestions?

Eugene
 
E

eugene

Thanks. May be helpful, but not sure. Will have to look at what they are
doing more carefully and maybe will have to tinker with code since the
articles deal with Excel 97 and do not deal directly with my problem with
hyperlinks. I am using Excel 03.

Eugene
 
E

eugene

When mouse is held over the link, it looks identical to the link in Excel.
But when you click the link, the error message I get has differences - "["
changes to something like "5b," and so on. It always claims the file cannot
be found. Even if it could be, I would not want to open the Excel file but
the corresponding HTML page. So in any case, it is imperative to have better
control over the output code. Ideally, the coverter would parse the hyperlink
formula and then set the link to the location and name of the file created.
But that may be asking too much - especially if the links are to other files.

My links are created programatically and are worksheet functions -
"=HYPERLINK..."

What I may try to do is change the hyperlink before I run the coversion
utility to see if I can improve my results.

But I would prefer a neater solution - if there is one.

Eugene
 
E

eugene

Aran,

Looked at the HTML code, and have a better handle on the problem.

html writes the xl item as
<td class=xl35 x:fmla="=HYPERLINK("[001.xls]i001.2!E15","i001.2")">

then one line below it writes its html counterpart
<a href="%5b001.xls%5di001.2!E15" target="_parent">i001.2</a></td>
note the changes

Even if it would somehow preserve the original it would be useless. When
converting, Excel creates one file per page. It names these files
Sheet001.htm etc.
It also creates an master file that loads all the individual sheets into
frames to give the browser an Excel feel - tabbed pages. The original link
points to Excel's tabbed pages in the same file. If the converter were
intelligent, it would understand that and rewrite the link to point to the
appropriate frame. But it seems to be clueless and does nothing of the sort.

I can probably find out how to write such links manually. If by some chance
you know, please post it. I may try to modify the links in the original
Excel file to force the converter to write the links properly. Probably
won't have a chance to do so until early next week though.

Eugene
 

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