View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Jim Rech[_2_] Jim Rech[_2_] is offline
external usenet poster
 
Posts: 533
Default xlTextPrinter and Accounting format

I wasn't trying to insult you, it's just that you never know how technical
people are.

I tried reproducing what you were doing, using Accounting format and saving
a PRN file via a macro. I got weird results initially. Even though I saw 2
decimal places on screen the PRN had 1 decimal place. Widening the columns
made it worse. The wider I went the more characters were cut off on the
right.

I only got what I wanted when I changed the definition of the Normal style
to a fixed width font, Courier specifically. This was the style being used
in the cells I used and doing this changes the font in the column and row
headers, and seems to work better in creating fixed width text files.
Anyway, I got exactly the right output after this.

--
Jim
wrote in message
...
I understand the difference in formats. I am also aware that changing
a file extension to .csv doesn't make its contents comma-seperated. I
was simply proposing that the commas in the accounting format may be
causing the problem.

I have worked on this issue further and discovered that the commas are
not the issue. I have found that when saving in xlTextPrinter format,
numbers in accounting format will only come out in full when their
columns are made much wider. I do not understand why this is the case,
but it certainly seems to be consistent.

If anyone has any insight on the matter, I would highly appreciate it.

Thanks.

On Mar 19, 9:49 am, "Jim Rech" wrote:
I suspect there may be conflict with the comma delimiter as in comma
seperated values


I don't understand what you mean by 'conflict'. If you save a PRN file
than
it is not a CSV file. The formats are different. Are you renaming the file
to CSV? That doesn't make it one.

--
wrote in message

...
| I'm using the xlTextPrinter file format to save fixed width text
| files, but I have run into a problem with "Accounting" formatted
| cells.
|
| When saved in xlTextPrinter format, the numbers in accounting formats
| have all of the digits after the first comma deleted. I suspect there
| may be conflict with the comma delimiter as in comma seperated values,
| but I'm not completely sure.
|
| Anyone have any experience with this? The code works perfectly in all
| other cases.