Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

HTML XML to create Excel 2000 multiple worksheet

Status
Not open for further replies.

stjacqd

Programmer
Jan 26, 2004
8
CA
Hello everyone

I am not use to play with HTML and XLM so sorry for my question.

My problem is related to the Excel 2000 version.

So, from the information took over the web, I generated an HTML file that is creating 2 excel worksheets. My only problem is I cannot write in the second worksheet even if the cursor is in, and I have to make it on only 1 html and/or XML format.

Here is the HTML code. PLEASE is some one can correct it to allow to write on the second worksheet without having to create another HTML file it will be great.

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

<body link=blue vlink=purple>

<!-- Creation of 2 worksheets - data1 and data2 -->
<xml>
 <x:ExcelWorkbook>
  <x:ExcelWorksheets>
   <x:ExcelWorksheet>
    <x:Name>data1</x:Name>
    <x:WorksheetOptions>
     <x:Selected/>
     <x:ProtectContents>False</x:ProtectContents>
     <x:ProtectObjects>False</x:ProtectObjects>
     <x:ProtectScenarios>False</x:ProtectScenarios>
    </x:WorksheetOptions>
   </x:ExcelWorksheet>

   <x:ExcelWorksheet>
    <x:Name>data22</x:Name>
    <x:WorksheetOptions>
     <x:Selected/>
     <x:ProtectContents>False</x:ProtectContents>
     <x:ProtectObjects>False</x:ProtectObjects>
     <x:ProtectScenarios>False</x:ProtectScenarios>
    </x:WorksheetOptions>
   </x:ExcelWorksheet>

  </x:ExcelWorksheets>
  <x:ActiveSheet>0</x:ActiveSheet>
  <x:ProtectStructure>False</x:ProtectStructure>
  <x:ProtectWindows>False</x:ProtectWindows>
 </x:ExcelWorkbook>
</xml>

<!-- Start to fill up the first worksheet -->
<!-- S1_R1_C1  S1_R1_C2 S1_R1_C3 -->
<!-- S1_R2_C1  S1_R2_C2 S1_R2_C3 -->
<table x:str border=0 cellpadding=0 cellspacing=0 width=128 style='border-collapse:
 collapse;table-layout:fixed;width:96pt'>
 <col width=64 span=2 style='width:48pt'>
 <tr height=17 style='height:12.75pt'>
  <td height=17 width=64 style='height:12.75pt;width:48pt'>S1_R1_C1</td>
  <td width=64 style='width:48pt'>S1_R1_C2</td>
  <td width=64 style='width:48pt'>S1_R1_C3</td>
 </tr>
 <tr height=17 style='height:12.75pt'>
  <td height=17 width=64 style='height:12.75pt;width:48pt'>S1_R2_C1</td>
  <td width=64 style='width:48pt'>S1_R2_C2</td>
  <td width=64 style='width:48pt'>S1_R2_C3</td>
 </tr>
</table>

<!-- It should select the second worksheet but that doesn't woek -->
<xml>
 <x:ExcelWorkbook>
   <x:ActiveSheet>1</x:ActiveSheet>
 </x:ExcelWorkbook>
</xml>

<!-- This should fillup the second worksheet but it is till write into the 1st one -->
<!-- S2_R1_C1  S2_R1_C2   S2_R1_C3 -->
<table x:str border=0 cellpadding=0 cellspacing=0 width=128 style='border-collapse:
 collapse;table-layout:fixed;width:96pt'>
 <col width=64 span=2 style='width:48pt'>
 <tr height=17 style='height:12.75pt'>
  <td height=17 width=64 style='height:12.75pt;width:48pt'>S2_R1_C1</td>
  <td width=64 style='width:48pt'>S2_R1_C2</td>
  <td width=64 style='width:48pt'>S2_R1_C3</td>
 </tr>
 <tr height=17 style='height:12.75pt'>
  <td height=17 style='height:12.75pt'>Row2</td>
  <td>Col2</td>
 </tr>

</table>

</body>
</html>

Save the code under file x.htm and open it with excel 2000 and you will have 2 worksheets created but all the data will be written into the first worksheet.

If some one can help to correct the code to make it work it will highly appreciated. Just remember I am stock with the excel 2000 limitations.

Regards
Daniel St-Jacques
 
Hello everyone

Is my request has been done into the wrong forum?

I didn't have any answer to my question.

Is my question is not clear or to heavy?

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top