2013-05-06 94 views
0

感谢您的帮助!Excel中的“忽略错误”XML

我基本上是通过XML创建一个excel文件......一切都很好,除了当我在excel中打开该文件时,它在每个单元格上都有那令人讨厌的绿色箭头......单击并具有选项“忽略错误”...我基本上希望XML有一条线可以告诉excell忽略这些“错误”。

我不想去excel propierties并修改excel如何显示这个......原因是excel文件将由数百人在不同的计算机上打开......我只是想在XML中的东西通知Excel将忽略这些错误......这是我的XML ...

<?xml version="1.0"?> 
<?mso-application progid="Excel.Sheet"?> 
<Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet" 
xmlns:o="urn:schemas-microsoft-com:office:office" 
xmlns:x="urn:schemas-microsoft-com:office:excel" 
xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet" 
xmlns:html="http://www.w3.org/TR/REC-html40"> 
    <Styles> 
    <Style ss:ID="Default" ss:Name="Normal"> 
     <Alignment ss:Vertical="Bottom"/> 
     <Borders/> 
     <Font/> 
     <Interior/> 
     <NumberFormat/> 
     <Protection/> 
    </Style> 
    <Style ss:ID="s_body"> 
     <Borders> 
     <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/> 
     </Borders> 
    </Style> 
    <Style ss:ID="s_aqua"> 
     <Borders> 
     <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/> 
     <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/> 
     <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/> 
     <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"/> 
     </Borders> 
     <Font x:Family="Swiss" ss:Bold="1"/> 
     <Interior ss:Color="#CCFFFF" ss:Pattern="Solid"/> 
    </Style> 
    <Style ss:ID="s_yellow"> 
     <Borders> 
     <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/> 
     <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/> 
     <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/> 
     <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"/> 
     </Borders> 
     <Font x:Family="Swiss" ss:Bold="1"/> 
     <Interior ss:Color="#FFFF40" ss:Pattern="Solid"/> 
    </Style> 
    <Style ss:ID="s_green"> 
     <Borders> 
     <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/> 
     <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/> 
     <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/> 
     <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"/> 
     </Borders> 
     <Font x:Family="Swiss" ss:Bold="1"/> 
     <Interior ss:Color="#6FFF6F" ss:Pattern="Solid"/> 
    </Style> 
    <Style ss:ID="s_wrap"> 
     <Alignment ss:Vertical="Bottom" ss:WrapText="1"/> 
    </Style> 
    <Style ss:ID="s8"> 
     <Alignment ss:Horizontal="Center" ss:Vertical="Bottom"/> 
     <Borders> 
     <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/> 
     <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/> 
     <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/> 
     <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"/> 
     </Borders> 
     <Font x:Family="Swiss" ss:Size="24" ss:Bold="1"/> 
    </Style> 
    </Styles> 
    <Worksheet ss:Name="Sheet1"> 
    <Table ss:ExpandedColumnCount="11" ss:ExpandedRowCount="9" x:FullColumns="1" 
    x:FullRows="1"> 
     <Column ss:Index="1" ss:StyleID="s_wrap" ss:AutoFitWidth="0" ss:Width="70"/> 
     <Column ss:Index="2" ss:StyleID="s_wrap" ss:AutoFitWidth="0" ss:Width="120"/> 
     <Column ss:Index="3" ss:StyleID="s_wrap" ss:AutoFitWidth="0" ss:Width="50"/> 
     <Column ss:Index="4" ss:StyleID="s_wrap" ss:AutoFitWidth="0" ss:Width="50"/> 
     <Column ss:Index="5" ss:StyleID="s_wrap" ss:AutoFitWidth="0" ss:Width="100"/> 
     <Column ss:Index="6" ss:StyleID="s_wrap" ss:AutoFitWidth="0" ss:Width="85"/> 
     <Column ss:Index="7" ss:StyleID="s_wrap" ss:AutoFitWidth="0" ss:Width="95"/> 
     <Column ss:Index="8" ss:StyleID="s_wrap" ss:AutoFitWidth="0" ss:Width="55"/> 
     <Column ss:Index="9" ss:StyleID="s_wrap" ss:AutoFitWidth="0" ss:Width="103"/> 
     <Column ss:Index="10" ss:StyleID="s_wrap" ss:AutoFitWidth="0" ss:Width="90"/> 
     <Column ss:Index="11" ss:StyleID="s_wrap" ss:AutoFitWidth="0" ss:Width="100"/> 
     <Row ss:Height="30"> 
     <Cell ss:MergeAcross="10" ss:StyleID="s8"> 
      <Data ss:Type="String">Example</Data> 
     </Cell> 
     </Row> 
     <Row> 
     <Cell ss:StyleID="s_aqua"> 
      <Data ss:Type="String">Column 1</Data> 
     </Cell> 
     <Cell ss:StyleID="s_aqua"> 
      <Data ss:Type="String">Column 2</Data> 
     </Cell> 
     <Cell ss:StyleID="s_aqua"> 
      <Data ss:Type="String">Column 3</Data> 
     </Cell> 
     <Cell ss:StyleID="s_yellow"> 
      <Data ss:Type="String">Column 4</Data> 
     </Cell> 
     <Cell ss:StyleID="s_yellow"> 
      <Data ss:Type="String">Column 5</Data> 
     </Cell> 
     <Cell ss:StyleID="s_yellow"> 
      <Data ss:Type="String">Column 6</Data> 
     </Cell> 
     <Cell ss:StyleID="s_yellow"> 
      <Data ss:Type="String">Column 7</Data> 
     </Cell> 
     <Cell ss:StyleID="s_green"> 
      <Data ss:Type="String">Column 8</Data> 
     </Cell> 
     <Cell ss:StyleID="s_green"> 
      <Data ss:Type="String">Column 9</Data> 
     </Cell> 
     <Cell ss:StyleID="s_green"> 
      <Data ss:Type="String">Column 10</Data> 
     </Cell> 
     <Cell ss:StyleID="s_green"> 
      <Data ss:Type="String">Column 11</Data> 
     </Cell> 
     </Row> 
     <Row> 
     <Cell> 
      <Data ss:Type="String">800000000051</Data> 
     </Cell> 
     <Cell> 
      <Data ss:Type="String">434412321</Data> 
     </Cell> 
     <Cell ss:StyleID="s_body"> 
      <Data ss:Type="String">3665382-4</Data> 
     </Cell> 
     <Cell> 
      <Data ss:Type="String">0</Data> 
     </Cell> 
     <Cell> 
      <Data ss:Type="String"> 
     </Data> 
     </Cell> 
     <Cell> 
      <Data ss:Type="String">4</Data> 
     </Cell> 
     <Cell ss:StyleID="s_body"> 
      <Data ss:Type="String">0</Data> 
     </Cell> 
     <Cell> 
      <Data ss:Type="String">0</Data> 
     </Cell> 
     <Cell> 
      <Data ss:Type="String"> 
     </Data> 
     </Cell> 
     <Cell> 
      <Data ss:Type="String">2</Data> 
     </Cell> 
     <Cell ss:StyleID="s_body"> 
      <Data ss:Type="String">0</Data> 
     </Cell> 
     </Row> 
     <Row> 
     <Cell> 
      <Data ss:Type="String">800000000051</Data> 
     </Cell> 
     <Cell> 
      <Data ss:Type="String">434412321</Data> 
     </Cell> 
     <Cell ss:StyleID="s_body"> 
      <Data ss:Type="String">3665382-4</Data> 
     </Cell> 
     <Cell> 
      <Data ss:Type="String">0</Data> 
     </Cell> 
     <Cell> 
      <Data ss:Type="String"> 
     </Data> 
     </Cell> 
     <Cell> 
      <Data ss:Type="String">4</Data> 
     </Cell> 
     <Cell ss:StyleID="s_body"> 
      <Data ss:Type="String">0</Data> 
     </Cell> 
     <Cell> 
      <Data ss:Type="String">0</Data> 
     </Cell> 
     <Cell> 
      <Data ss:Type="String"> 
     </Data> 
     </Cell> 
     <Cell> 
      <Data ss:Type="String">2</Data> 
     </Cell> 
     <Cell ss:StyleID="s_body"> 
      <Data ss:Type="String">0</Data> 
     </Cell> 
     </Row> 
    </Table> 
    <DataValidation xmlns="urn:schemas-microsoft-com:office:excel"> 
     <Range>R2C2:R1000C2</Range> 
     <Type>List</Type> 
     <CellRangeList/> 
     <Value>"Red, Black, Green"</Value> 
    </DataValidation> 
    </Worksheet> 
</Workbook> 

回答

0

的绿色标记表明,在一个小区中类似于身为 Excel中。

尝试使用ss:Type="Number"代替ss:Type="String"代替所有数值,并且您将绿色标记除去,例如,

<Cell> 
     <Data ss:Type="Number">800000000051</Data> 
    </Cell> 
    <Cell> 
     <Data ss:Type="Number">434412321</Data> 
    </Cell> 
    <Cell> 
     <Data ss:Type="String">Some Text</Data> 
    </Cell>