View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Eric Eric is offline
external usenet poster
 
Posts: 1,670
Default Excel Workbook.SaveAs xml spreadsheet gives garbage number

Hi,

I use excel library API "workbook.saveas" just like below:

book.SaveAs(tempXmlFile, XlFileFormat.xlXMLSpreadsheet, Missing.Value,
Missing.Value, false, false, XlSaveAsAccessMode.xlExclusive, Missing.Value,
Missing.Value, Missing.Value, Missing.Value, Missing.Value);



some of the data in excel is in "Number" format and sometimes the number get
into garbage value after i save it in xml spreadsheet. For instance: 10.21
become 10.2099999.



this happen only after i use office 2007, it is working fine under office
2003. The only way to get around this is to cut and paste the entire excel
content and reformat them in "Text". The problem with this is I cannot
prevent others who use excel 2007 from having number format, and it will
return me wrong value "10.2099999" instead of "10.21".



Is this ia known bug in excel 2007 API? is there anyway to get around this
by not forcing everyone to take care their own excel data formating?



thanks,

eric