View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Jim Cone[_2_] Jim Cone[_2_] is offline
external usenet poster
 
Posts: 1,549
Default SaveAs call changes text to #####


Change the cell format to "General"
--
Jim Cone
Portland, Oregon USA



"dawn"
wrote in message
I have this piece of VB code in Excel that takes in various Excel files and
translates them into tab delimited text files. The code to go through the
files in the directory one by one and do the export does not work in Excel
2007 so I have modified it. I now have it exporting the files. However,
some of them are not exporting correctly. If the data in the cell is too
many characters, it exports the field as ########### instead of the values.

This is the code to do the export of the individual files:

-snip-

I have narrowed the problem down to this line: wrkbk.SaveAs flPath,
xlTextWindows - when I step through the Do Until loops, the cell.Value of the
cell in question is what is supposed to be but when the SaveAs call is made,
it converts the cell to #############.

I am at a loss. As a note, this is not the function I was working on - this
same call (wrkbk.SaveAs) is used in Excel 2003 and the cells are exported
correctly. There is no other difference in the .xls files that are being
changed to text format. I have also verified it is not the data itself - but
rather the length of the data.

Thank you.