views:

68

answers:

2
+1  Q: 

What's XLSHTML?

What's XLSHTML?

I want to generate, as simply as possible, a file which will open in Excel when a user double-clicks it, and which has some minimal styling.

XLS meets my user requirements, but it's not easy to generate. CSV is easy to generate but has no styling. HTML is easy to generate and has styling but won't open in Excel when double-clicked (you can File->Open it but that's not sufficient, and you can save it as .XLS but then the user gets a warning).

I see in the file extension associations on this PC that there's an extension ".xlshtml", a "Microsoft Office Excel HTML Document", which opens in Excel by default. That looks promising. However, I can't figure out what it is. It's not simply HTML (that gives the warning as above, suggesting my plain HTML isn't it). My version of Excel can't save it. MSDN has virtually nothing on it, and Google seems to only turn up pages that list in as a possible filename extension for Excel files.

Does anybody know what these are? Is it just some special form of HTML that Excel likes? Does anybody have a sample I can see?

EDIT: Based on Divo's hint, I found this. It looks like an Office 2000 / 10 feature that let you save HTML with Office's extra native features in XML islands. It looks like a fairly strict format which they deprecated because nobody used it. I'm still looking through the docs I found, but I haven't figured out how to make a file in this format yet.

A: 

I dont have an example but id bet you there is a corresponding XSD or DTD for it. Perhaps trying makign a dummy Excel doc and save it as that. If it uses a DTD/XSD it should be inline or have a reference to it somewhere.

prodigitalson
What version of Excel do I need? (See: "My version of Excel can't save it")
Ken
A: 

I can create the following file:

<html>
<body>
<table>
    <tr>
        <td>1</td>
        <td>2</td>
    </tr>
    <tr>
        <td>3</td>
        <td>4</td>
    </tr>
</table>        
</body>
</html>

...and then save it with an .xls extension, I can then double-click it and it opens in Excel. I don't get a warning in that case.

Granted, it's unstyled, so you'd have to reverse-engineer MS's proprietary CSS it likes to use when exporting an XLS file as HTML.

DA
It gives a warning here. Either you're using a different version of Excel, or you have some setting that turns off the warnings -- neither of which I can assume about my users.
Ken