Excel vs. CSV format

We have some tools that require files formatted in the CSV (comma-separated value) format. I use Excel to edit this file and save it as CSV. However, Excel has the nasty habit of lopping off decimal places in numbers if it thinks they are not needed. For instance, I have a column for Release numbers. "17.0" is a valid release number but "17" is not. However, regardless of how many different ways I format the column as General, Text or Number with 1 decimal place, when I reload the CSV file it still has 17. This is because format information is not preserved in CSV... A relate Microsoft acknowledgement of this problem is at: http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q216023 But their solution does not work. I wonder if I have to save it as a Excel workbook (xls) and then convert it to CSV when we need it... Stupid! Excel SHOULD just provide an option to load in the values as they see them when loading a CSV and NOT interpret the values as numbers, text, dates, etc... Suggestion? Regards, Jeff
I was going to furthur develop those so you could have a save and load button, but it really starts to depend on your needs. All I have to add is that these two functions can be useful if you go down that path: [code:1] Application.Dialogs(xlDialogSaveAs).Show arg1:="filename.csv" arg2:=xlCSVWindows [/code:1] and [code:1] Application.Dialogs(xlDialogImportTextFile).Show [/code:1] Using these and maybe a line to rename the file (after it's saved) could get you there. I'd also decode the {} tags immediately after saving (so the author can just click the export macro button then keep working).

Post new comment

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
  • You can use BBCode tags in the text.
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>. Beside the tag style "<foo>" it is also possible to use "[foo]".

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor, sorry but we need it to help prevent automated submissions.
one plus seven equals
Solve this math question and enter the solution with digits. E.g. for "two plus four = ?" enter "6".