L
livefree75
Math,
Just figured this out, with your code as an example. In my case, I
was not only trying to retain the gridlines, but also force the group
summary rows above the detail.
All you need from your code below is the following. The part I was
missing was xmlns attributes in the <html> tag. This tells Excel to
read your <xml> directives, rather than creating its own.
<html xmlns="urn:schemas-microsoft-comfficeffice"
xmlns:x="urn:schemas-microsoft-comffice:excel"
xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=Content-Type content="text/html;
charset=windows-1252"> <!-- charset is your choice -->
<!--[if gte mso 9]>
<xml>
<x:ExcelWorkbook>
<x:ExcelWorksheet>
<x:Name>Your sheetname here</x:Name>
<x:WorksheetOptions>
<x:NoSummaryRowsBelowDetail/><!-- this was for my problem -->
<xisplayGridlines/><!-- this is for your problem -->
</x:WorksheetOptions>
</x:ExcelWorksheet>
</x:ExcelWorksheets>
</x:ExcelWorkbook>
</xml>
<![endif]-->
</head>
<body>
<!-- Your data here -->
</body>
</html>
Just figured this out, with your code as an example. In my case, I
was not only trying to retain the gridlines, but also force the group
summary rows above the detail.
All you need from your code below is the following. The part I was
missing was xmlns attributes in the <html> tag. This tells Excel to
read your <xml> directives, rather than creating its own.
<html xmlns="urn:schemas-microsoft-comfficeffice"
xmlns:x="urn:schemas-microsoft-comffice:excel"
xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=Content-Type content="text/html;
charset=windows-1252"> <!-- charset is your choice -->
<!--[if gte mso 9]>
<xml>
<x:ExcelWorkbook>
<x:ExcelWorksheet>
<x:Name>Your sheetname here</x:Name>
<x:WorksheetOptions>
<x:NoSummaryRowsBelowDetail/><!-- this was for my problem -->
<xisplayGridlines/><!-- this is for your problem -->
</x:WorksheetOptions>
</x:ExcelWorksheet>
</x:ExcelWorksheets>
</x:ExcelWorkbook>
</xml>
<![endif]-->
</head>
<body>
<!-- Your data here -->
</body>
</html>
That sort of thing was my first thought - borders, background, etc -
but it's not the case. The tick box for gridlines in the options is
empty when I open the file.- Hide quoted text -
- Show quoted text -
So far, I've managed to reinstate the grid lines by copying in some
lines from an Excel html file, into a basic file that I typed up in
Notepad (see below)
<html xmlns="urn:schemas-microsoft-comfficeffice"
xmlns:x="urn:schemas-microsoft-comffice:excel"
xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=Content-Type content="text/html;
charset=windows-1252">
<meta name=ProgId content=Excel.Sheet>
<meta name=Generator content="Microsoft Excel 11">
<style>
<!--table
@page{}
-->
</style>
<!--[if gte mso 9]><xml>
<x:ExcelWorkbook><x:ExcelWorksheets><x:ExcelWorksheet>
<x:Name>Sheet1</x:Name>
<x:WorksheetOptions><xanes>
</xanes></x:WorksheetOptions>
</x:ExcelWorksheet></x:ExcelWorksheets></
x:ExcelWorkbook>
</xml>
<![endif]-->
</head>
<body>
<table>
<tr>
<td>1</td>
<td>2</td>
</tr>
</table>
</body></html>
But if anyone can show me a more succinct way of doing this, I'd be
very grateful.