ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Excel Workbook.SaveAs xml spreadsheet gives garbage number (https://www.excelbanter.com/excel-programming/411304-excel-workbook-saveas-xml-spreadsheet-gives-garbage-number.html)

Eric

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



All times are GMT +1. The time now is 09:38 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com