View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
John Keith[_2_] John Keith[_2_] is offline
external usenet poster
 
Posts: 175
Default saving in other File types

Are you trying to make the output file have values that are in fixed columns?

It is much better to use Excel VBA to read in the data from the cells, then
output the data directly to a .TXT file where you can use string functions to
build your output exactly the field lenghts you want, truncating any extra
characters. (On my applications I needed this to upload excel data to a
mainframe) PRN files were a mess to deal with; even when using a fixed font
and trying to keep the data cells sized properly.

Left$(vaData(lRow, 1) & Space(37), 37)
.....to create a 37 length string right padded with spaces.
then string the results of multiple strings to make up your file.

Or am I missing your point (about which format you needed)?

HTH
--
Regards,
John


"Jason" wrote:

hi,

i am trying to write a code to save an excel sheet into a formatted space
delimited file type, (.PRN). i tried to save it directly using

workbooks.save(c:filename.prn), it saves it as prn but not the format that i
need, i know that its possible to specify the file type, but i would be
really thankfull if some one could help me...thanks