468,107 Members | 1,386 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,107 developers. It's quick & easy.

Need some help with compatability with Excel 2007

Folks,

Probably don't have the right forum here, but this is all a bit new to me. I have a web site that sends me a daily email with an excel spreadsheet attachment that contains some customer data. Sadly, now that I am using Excel 2007, I can't open the file for some reason. The code I am using to generate the file is below. Am I missing something obvious as it opens fine in Excel 2003. I am asking here as I think it's javascript, but I'm probably wrong on that one! Code below.

Any help much appreciated!

Thanks,

Nick
Expand|Select|Wrap|Line Numbers
  1. {startXml:h}
  2. <Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet"
  3.  xmlns:o="urn:schemas-microsoft-com:office:office"
  4.  xmlns:x="urn:schemas-microsoft-com:office:excel"
  5.  xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet"
  6.  xmlns:html="http://www.w3.org/TR/REC-html40">
  7.  <DocumentProperties xmlns="urn:schemas-microsoft-com:office:office">
  8.  </DocumentProperties>
  9.  <OfficeDocumentSettings xmlns="urn:schemas-microsoft-com:office:office">
  10.   <DownloadComponents/>
  11.  </OfficeDocumentSettings>
  12.  <ExcelWorkbook xmlns="urn:schemas-microsoft-com:office:excel">
  13.   <WindowHeight>9345</WindowHeight>
  14.   <WindowWidth>11340</WindowWidth>
  15.   <WindowTopX>480</WindowTopX>
  16.   <WindowTopY>60</WindowTopY>
  17.   <ActiveSheet>0</ActiveSheet>
  18.   <ProtectStructure>False</ProtectStructure>
  19.   <ProtectWindows>False</ProtectWindows>
  20.  </ExcelWorkbook>
  21.  <Styles>
  22.   <Style ss:ID="Default" ss:Name="Normal">
  23.    <Alignment ss:Vertical="Bottom"/>
  24.    <Borders/>
  25.    <Font ss:FontName="Arial"/>
  26.    <Interior/>
  27.    <NumberFormat/>
  28.    <Protection/>
  29.   </Style>
  30.   <Style ss:ID="s21" ss:Name="Link">
  31.    <Font ss:FontName="Arial" ss:Color="#0000FF"
  32.     ss:Underline="Single"/>
  33.   </Style>
  34.   <Style ss:ID="s28">
  35.    <Font ss:FontName="Arial" ss:Bold="1"/>
  36.   </Style>
  37.   <Style ss:ID="s32">
  38.    <NumberFormat ss:Format="[$$-409]#,##0.00"/>
  39.   </Style>
  40.   <Style ss:ID="s35">
  41.    <NumberFormat ss:Format="Short Date"/>
  42.   </Style>
  43.   <Style ss:ID="s37">
  44.    <Font ss:FontName="Arial" ss:Bold="1"/>
  45.    <NumberFormat ss:Format="Short Date"/>
  46.   </Style>
  47.   <Style ss:ID="s39">
  48.    <Font ss:Bold="1"/>
  49.    <NumberFormat ss:Format="[$$-409]#,##0.00"/>
  50.   </Style>
  51.  </Styles>
  52.  <Worksheet ss:Name="customers">
  53.    <Table ss:ExpandedColumnCount="22" x:FullColumns="1" x:FullRows="1">
  54. <!--   <Row>
  55.     <Cell ss:StyleID="s28"><Data ss:Type="String">New customers</Data></Cell>
  56.    </Row>-->
  57.    <Row>
  58.     <Cell><Data ss:Type="String">Title</Data></Cell>
  59.     <Cell><Data ss:Type="String">First name</Data></Cell>
  60.     <Cell><Data ss:Type="String">Surname</Data></Cell>
  61.     <Cell><Data ss:Type="String">Billing company</Data></Cell>
  62.     <Cell><Data ss:Type="String">Billing phone</Data></Cell>
  63.     <Cell><Data ss:Type="String">Billing fax</Data></Cell>
  64.     <Cell><Data ss:Type="String">Billing address</Data></Cell>
  65.     <Cell><Data ss:Type="String">Billing city</Data></Cell>
  66.     <Cell><Data ss:Type="String">Billing state</Data></Cell>
  67.     <Cell><Data ss:Type="String">Billing country</Data></Cell>
  68.     <Cell><Data ss:Type="String">Billing zipcode</Data></Cell>
  69.     <Cell><Data ss:Type="String">Shipping company</Data></Cell>
  70.     <Cell><Data ss:Type="String">Shipping phone</Data></Cell>
  71.     <Cell><Data ss:Type="String">Shipping fax</Data></Cell>
  72.     <Cell><Data ss:Type="String">Shipping address</Data></Cell>
  73.     <Cell><Data ss:Type="String">Shipping city</Data></Cell>
  74.     <Cell><Data ss:Type="String">Shipping state</Data></Cell>
  75.     <Cell><Data ss:Type="String">Shipping country</Data></Cell>
  76.     <Cell><Data ss:Type="String">Shipping zipcode</Data></Cell>
  77.     <Cell><Data ss:Type="String">Contact mail</Data></Cell>
  78.     <Cell><Data ss:Type="String">Membership</Data></Cell>
  79.     <Cell><Data ss:Type="String">Membership expiry</Data></Cell>
  80.     <Cell><Data ss:Type="String">Vehicle regisration number</Data></Cell>
  81.     <Cell><Data ss:Type="String">Contact phone number</Data></Cell>
  82.    </Row>
  83.    <Row FOREACH="customers,c">
  84.     <Cell><Data ss:Type="String">{c.billing_title}</Data></Cell>
  85.     <Cell><Data ss:Type="String">{c.billing_firstname:t}</Data></Cell>
  86.     <Cell><Data ss:Type="String">{c.billing_lastname:t}</Data></Cell>
  87.     <Cell><Data ss:Type="String">{c.billing_company:t}</Data></Cell>
  88.     <Cell><Data ss:Type="String">{c.billing_phone:t}</Data></Cell>
  89.     <Cell><Data ss:Type="String">{c.billing_fax:t}</Data></Cell>
  90.     <Cell><Data ss:Type="String">{c.billing_address:t}</Data></Cell>
  91.     <Cell><Data ss:Type="String">{c.billing_city:t}</Data></Cell>
  92.     <Cell><Data ss:Type="String">{c.billingState.state:t}</Data></Cell>
  93.     <Cell><Data ss:Type="String">{c.billingCountry.country:t}</Data></Cell>
  94.     <Cell><Data ss:Type="String">{c.billing_zipcode:t}</Data></Cell>
  95.     <Cell><Data ss:Type="String">{c.shipping_company:t}</Data></Cell>
  96.     <Cell><Data ss:Type="String">{c.shipping_phone:t}</Data></Cell>
  97.     <Cell><Data ss:Type="String">{c.shipping_fax:t}</Data></Cell>
  98.     <Cell><Data ss:Type="String">{c.shipping_address:t}</Data></Cell>
  99.     <Cell><Data ss:Type="String">{c.shipping_city:t}</Data></Cell>
  100.     <Cell><Data ss:Type="String">{c.shippingState.state:t}</Data></Cell>
  101.     <Cell><Data ss:Type="String">{c.shippingCountry.country:t}</Data></Cell>
  102.     <Cell><Data ss:Type="String">{c.shipping_zipcode:t}</Data></Cell>
  103.     <Cell><Data ss:Type="String">{c.login}</Data></Cell>
  104.     <Cell><Data ss:Type="String">{c.pending_membership}</Data></Cell>
  105.     <Cell><Data ss:Type="String">{time_format(c.membership_exp_date)}</Data></Cell>
  106.     <Cell><Data ss:Type="String">{foreach:c.vehicles,v}   {v.vehicle_registration_number}   {end:}</Data></Cell>
  107.     <Cell><Data ss:Type="String">{foreach:c.vehicles,v}   {v.contact_phone_number}   {end:}</Data></Cell>
  108.     </Row>
  109.   </Table>
  110.   <WorksheetOptions xmlns="urn:schemas-microsoft-com:office:excel">
  111.    <PageSetup>
  112.     <PageMargins x:Bottom="0.984251969" x:Left="0.78740157499999996"
  113.      x:Right="0.78740157499999996" x:Top="0.984251969"/>
  114.    </PageSetup>
  115.    <Print>
  116.     <ValidPrinterInfo/>
  117.     <PaperSizeIndex>9</PaperSizeIndex>
  118.     <HorizontalResolution>600</HorizontalResolution>
  119.     <VerticalResolution>600</VerticalResolution>
  120.    </Print>
  121.    <Panes>
  122.     <Pane>
  123.      <Number>3</Number>
  124.      <ActiveRow>1</ActiveRow>
  125.      <ActiveCol>1</ActiveCol>
  126.     </Pane>
  127.    </Panes>
  128.    <ProtectObjects>False</ProtectObjects>
  129.    <ProtectScenarios>False</ProtectScenarios>
  130.   </WorksheetOptions>
  131.  </Worksheet>
  132. </Workbook>
  133.  
Jan 16 '08 #1
4 2352
acoder
16,027 Expert Mod 8TB
Welcome to The Scripts!

This is definitely not JavaScript. It looks like XML, so I'm moving it to the XML forum for now where hopefully someone will help you. Good luck!
Jan 17 '08 #2
jkmyoung
2,057 Expert 2GB
Where you have:
<Table ss:ExpandedColumnCount="22"

Change to
<Table ss:ExpandedColumnCount="24"

You have 24 columns (A-X), so Excel bugs out when you say you have less. Note. you can replace with anything at least 24. eg put 99 and it will work.
Jan 17 '08 #3
Thanks for the tip.

I also note that the file I receive is named 'customers.xls' when it is fact a .xml file. Any idea how I might change the extension to .xml for when the file is sent. Is the extension coded somewhere in their?

Thanks very much,

Nick
Jan 18 '08 #4
jkmyoung
2,057 Expert 2GB
Probably just rename the file, and remove the header
{startXml:h}
Jan 18 '08 #5

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

11 posts views Thread by cybervigilante | last post: by
15 posts views Thread by =?Utf-8?B?c2hhc2hhbmsga3Vsa2Fybmk=?= | last post: by
5 posts views Thread by LadyIlsebet | last post: by
1 post views Thread by Solo | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.