Changing to Landscape mode automatically

J

Joe McCormick

I am trying to use HTML/XML to import an HTML report into Excel 2002.
I am having problems setting up the worksheet so it will print in
landscape mode. I want to use XML since I ultimately want to create
one workbook with several worksheets.

I can get most of my formatting done, but I can't change to landscape.
I think the "mso-page-orientation" should work, but it doesn't. What
is even more confusing is that the report will be landscape if I open
the report in Excel, but it isn't if I have the HTML/XML program open
it.

Here is the HTML/XML code I want to use to read in the HTML report.
This file is saved with an "XLS" extension.

<html xmlns:x="urn:schemas-microsoft-com:eek:ffice:excel">
<head>
<meta http-equiv=Content-Type content="text/html;
charset=windows-1252">
<meta name="Excel Workbook Frameset">
<title>Report Title</title>
<xml>
<x:ExcelWorkbook>
<x:ExcelWorksheets>
<x:ExcelWorksheet>
<x:Name>HTML Report</x:Name>
<x:WorksheetSource HRef="h:\test2.html" />
</x:ExcelWorksheet>
</x:ExcelWorksheets>
</x:ExcelWorkbook>
</xml>
</head>
<body></body>
</html>


Here is the HTML report I want to import. It's name is test2.html and
is read by the previous file.


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html xmlns:eek:="urn:schemas-microsoft-com:eek:ffice:eek:ffice"
xmlns:x="urn:schemas-microsoft-com:eek:ffice:excel">

<head>
<meta http-equiv=Content-Type content="text/html;
charset=windows-1252">
<meta name=ProgId content=Excel.Sheet>
<meta name=Generator content="Microsoft Excel 10">
<title>Output</title>

<style>
<!--table
table
{mso-displayed-decimal-separator:"\.";
mso-displayed-thousand-separator:"\,";}
@page
{margin:.25in .25in .25in .25in;
mso-header-margin:.25in;
mso-footer-margin:.25in;
mso-page-orientation:landscape;
mso-horizontal-page-align:center;
mso-vertical-page-align:center;}
-->
</style>
<!--[if gte mso 9]><xml>
<x:ExcelWorkbook>
<x:ExcelWorksheets>
<x:ExcelWorksheet>
<x:WorksheetOptions>
<x:FitToPage/>
<x:print>
<x:ValidPrinterInfo/>
<x:HorizontalResolution>600</x:HorizontalResolution>
<x:VerticalResolution>600</x:VerticalResolution>
</x:print>
<x:Selected/>
</x:WorksheetOptions>
</x:ExcelWorksheet>
</x:ExcelWorksheets>
</x:ExcelWorkbook>
</xml><![endif]-->
</head>

<body link="#0066CC" vlink="#003366" class=xl24 leftmargin=8
rightmargin=8>

<TABLE cellspacing=1 cellpadding=1 rules=NONE frame=VOID border=0
width=100% bgcolor="#E0E0E0">
<TR>
<TD ALIGN=CENTER bgcolor="#E0E0E0" colspan=3><font face="Arial,
Helvetica, Helv" size="5" color="#002288"><b><i>Test HTML in Excel -
Worksheet #1</i></b></font></TD>
</TR>
</TABLE>
</font></CENTER>
<P>
<CENTER>
<font face="Arial, Helvetica, Helv" size="3" color="#002288">
<TABLE cellspacing=1 cellpadding=7 rules=GROUPS frame=BOX border=1
bgcolor="#F0F0F0" bordercolor="#000000">
<thead>
<TR>
<TD ALIGN=CENTER bgcolor="#B0B0B0"><font size="4"
color="#0033AA"><b>Obs</b></font></TD>
<TD ALIGN=CENTER bgcolor="#B0B0B0"><font size="4"
color="#0033AA"><b>Country</b></font></TD>
<TD ALIGN=LEFT bgcolor="#B0B0B0"><font size="4"
color="#0033AA"><b>City</b></font></TD>
</TR>
</thead>
<tbody>
<TR>
<TD ALIGN=RIGHT bgcolor="#B0B0B0"><font size="3"
color="#0033AA">1</font></TD>
<TD ALIGN=LEFT bgcolor="#D3D3D3"><font size="3"
color="#000000">Australia</font></TD>
<TD ALIGN=LEFT bgcolor="#D3D3D3"><font size="3"
color="#000000">Sydney</font></TD>
</TR>
<TR>
<TD ALIGN=RIGHT bgcolor="#B0B0B0"><font size="3"
color="#0033AA">2</font></TD>
<TD ALIGN=LEFT bgcolor="#D3D3D3"><font size="3" color="#000000">New
Zealand</font></TD>
<TD ALIGN=LEFT bgcolor="#D3D3D3"><font size="3"
color="#000000">Queenstown</font></TD>
</TR>
<TR>
<TD ALIGN=RIGHT bgcolor="#B0B0B0"><font size="3"
color="#0033AA">3</font></TD>
<TD ALIGN=LEFT bgcolor="#D3D3D3"><font size="3"
color="#000000">United States</font></TD>
<TD ALIGN=LEFT bgcolor="#D3D3D3"><font size="3"
color="#000000">Denver</font></TD>
</TR>
</tbody>
</TABLE>

</body>

</html>

Can anybody tell my why it won't go to landscape when I use the
HTML/XML program? Or can anybody suggest an alternative to getting
landscape to work?

Thanks for your help.
Joe McCormick
 

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