It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Board index Programming XML Forum

Create html/xml loadable into excel 2000

Create html/xml loadable into excel 2000

Postby stjacqd on Fri Apr 13, 2007 8:33 pm

Hello everyone

I am trying to create an html/xml that will load data in 2 different worksheets into excel 2000.

the following code create 2 worksheets, but put all the data into the first one.

Is anybody can tell me what has to be done to be able to write the data to the second worksheet?
Code: Select all
<html xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns:x="urn:schemas-microsoft-com:office: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 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>data2</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:ProtectStructure>False</x:ProtectStructure>
  <x:ProtectWindows>False</x:ProtectWindows>
</x:ExcelWorkbook>
</xml>

<!-- Fill up the first worksheet -->
<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>

<!-- Should activate the second worksheet -->
<xml>
<x:ExcelWorkbook>
   <x:ActiveSheet>1</x:ActiveSheet>
</x:ExcelWorkbook>
</xml>

<!-- Should fillup the second worksheet -->
<!-- S2_R1_C1  S2_R1_C2  S2_R1_C3  -->
<!-- S2_R2_C1  S2_R2_C2                   -->
<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'>S2_R2_C1</td>
  <td>S2_R2_C2</td>
</tr>
</table>

</body>
</html>


If you are saving the code into a file (test.htm) you will be able to load it into excel but all the data will be into the worksheet (data1) and the cursor will end on the worksheet (data2) without any data in it.

I cannot have more than 1 html/xml file. That file will be generated by a 3rd party program.

Any suggestion will be highly appreciated.
stjacqd
stjacqd
 
Posts: 4
Joined: Fri Apr 13, 2007 7:33 pm
Location: Montreal

Postby stjacqd on Tue Apr 17, 2007 2:33 pm

Hello everyone

I didn't received any answer yet.

Is my question has been posted to the wrong forum or is the question is to heavy?
stjacqd
 
Posts: 4
Joined: Fri Apr 13, 2007 7:33 pm
Location: Montreal

Postby nighthawk on Wed Apr 18, 2007 8:53 pm

You didn't receive any answer yet because you posted your question on Friday 13. :)


I'm not xml expert, but try to export the kind of document you need from excel and then look at it, see what you have to do.

Have you tried to run it on different versions of excel and/or on different PCs, maybe your installation of excel is messed up.

This probably isn't very helpfull, but since there is no one here...
The Zeitgeist Movement
User avatar
nighthawk
250+ Club
 
Posts: 420
Joined: Sun Jun 11, 2006 1:53 pm
Location: SFRJ

Postby stjacqd on Mon Apr 23, 2007 1:40 pm

Hello nightHaw

Thank you for you reply.

I already export from excel 2000 in html. the problem is excel 2000 is generating several html files when you have several sheets.

I am looking to have only 1 html and or xml file to be able to recreate it from another software.

Regards
stjacqd
stjacqd
 
Posts: 4
Joined: Fri Apr 13, 2007 7:33 pm
Location: Montreal

Re: Create html/xml loadable into excel 2000

Postby jacob123 on Tue Feb 01, 2011 8:27 am

This is right way to create html loadable into excel 2000 .This program is useful.
jacob123
 
Posts: 1
Joined: Tue Feb 01, 2011 7:10 am


Who is online

Users browsing this forum: No registered users and 0 guests