Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 367
Default saving in other File types

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default saving in other File types

I needed to do the same thing. My spreadsheet was setup as a template but
you can use any format. Here is what I found to work:

If Activeworkbook.Fileformat=xltemplate then
activeworkbook.saveas "O:\Myfolder\Myfile.prn", xlCurrentPlatformText
EndIf

If you have a multi-sheet workbook this will rename the sheet you are
working with. You can always copy the specific worksheet you want to use by
using:
Sheets("Sheet3").Copy and then use the save as written above.

I hope this helps,
Cheryl

"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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I hide unused file types from file types list in save dial Estra Q Excel Discussion (Misc queries) 1 December 17th 09 12:36 PM
Excel 2007 error "some chart types cannot be combined with other chart types. Select a different chart types" roadsidetree Charts and Charting in Excel 15 June 2nd 09 10:53 AM
QPW file types lryan79 Excel Discussion (Misc queries) 1 October 16th 08 07:38 AM
Excel File Types sam1 Excel Discussion (Misc queries) 0 August 11th 05 09:28 PM
Custom File Types Paul D[_2_] Excel Programming 1 October 9th 03 02:36 PM


All times are GMT +1. The time now is 02:51 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"