Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Printing to File using PrintOut

Having checked the output in print preview I'm trying to then print to file
but despite having given a PrToFileName it always produces a popup asking for
the file name. Other than this it works fine and does work if I give the
name at the prompt, it's just that I want to automated the file naming.
I'm using Excel 2000. Can someone please point out my mistake.
The PrintOut line is all on one line it's just split on this posting.

fname = "C:\temp.fax"
Sheets(Array("statistics", "graph")).PrintOut Preview:=True,
ActivePrinter:="Faxmaker on Ne00:", PrintToFile:=True, PrToFileName:=fname


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,758
Default Printing to File using PrintOut

In some simple testing, if I removed the preview:=true, then everything worked
ok.

Just a guess, but it looks like if preview:=true, then excel figures that the
user may want to specify their own filename.

And it looks kind of weird that you'd be creating a binary file in Faxmaker
format.

When I use print to file, it's usually so I can use some old DOS command to send
the .prn file to the printer:

copy /b c:\temp.prn lpt1

I'm not sure Fax printers do the same thing????


Tim Baker wrote:

Having checked the output in print preview I'm trying to then print to file
but despite having given a PrToFileName it always produces a popup asking for
the file name. Other than this it works fine and does work if I give the
name at the prompt, it's just that I want to automated the file naming.
I'm using Excel 2000. Can someone please point out my mistake.
The PrintOut line is all on one line it's just split on this posting.

fname = "C:\temp.fax"
Sheets(Array("statistics", "graph")).PrintOut Preview:=True,
ActivePrinter:="Faxmaker on Ne00:", PrintToFile:=True, PrToFileName:=fname


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Printing to File using PrintOut

Thanks, didn't think of trying it without preview. I'm currently using it
just with the preview and wanted to add the output to file option. Seems
I'll have to approach it a different way.

Traditionally we have a report which used to be faxed out to several other
people. They have asked for an electronic version and the simplest option
was to send them a file which they could view using Imaging and the faxmaker
format enables this.


"Dave Peterson" wrote:

In some simple testing, if I removed the preview:=true, then everything worked
ok.

Just a guess, but it looks like if preview:=true, then excel figures that the
user may want to specify their own filename.

And it looks kind of weird that you'd be creating a binary file in Faxmaker
format.

When I use print to file, it's usually so I can use some old DOS command to send
the .prn file to the printer:

copy /b c:\temp.prn lpt1

I'm not sure Fax printers do the same thing????


Tim Baker wrote:

Having checked the output in print preview I'm trying to then print to file
but despite having given a PrToFileName it always produces a popup asking for
the file name. Other than this it works fine and does work if I give the
name at the prompt, it's just that I want to automated the file naming.
I'm using Excel 2000. Can someone please point out my mistake.
The PrintOut line is all on one line it's just split on this posting.

fname = "C:\temp.fax"
Sheets(Array("statistics", "graph")).PrintOut Preview:=True,
ActivePrinter:="Faxmaker on Ne00:", PrintToFile:=True, PrToFileName:=fname


--

Dave Peterson

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,758
Default Printing to File using PrintOut

Thanks for the explanation. I would never have thought of creating a .tif file
that way. (My FAX software uses .tif as a default.)

I'm not sure how big your document is, but you can take a picture of part of
your worksheet (select the range, shift-edit|copy) and even paste that into the
body of an html email.

If it's a small range, it might work for you.





Tim Baker wrote:

Thanks, didn't think of trying it without preview. I'm currently using it
just with the preview and wanted to add the output to file option. Seems
I'll have to approach it a different way.

Traditionally we have a report which used to be faxed out to several other
people. They have asked for an electronic version and the simplest option
was to send them a file which they could view using Imaging and the faxmaker
format enables this.

"Dave Peterson" wrote:

In some simple testing, if I removed the preview:=true, then everything worked
ok.

Just a guess, but it looks like if preview:=true, then excel figures that the
user may want to specify their own filename.

And it looks kind of weird that you'd be creating a binary file in Faxmaker
format.

When I use print to file, it's usually so I can use some old DOS command to send
the .prn file to the printer:

copy /b c:\temp.prn lpt1

I'm not sure Fax printers do the same thing????


Tim Baker wrote:

Having checked the output in print preview I'm trying to then print to file
but despite having given a PrToFileName it always produces a popup asking for
the file name. Other than this it works fine and does work if I give the
name at the prompt, it's just that I want to automated the file naming.
I'm using Excel 2000. Can someone please point out my mistake.
The PrintOut line is all on one line it's just split on this posting.

fname = "C:\temp.fax"
Sheets(Array("statistics", "graph")).PrintOut Preview:=True,
ActivePrinter:="Faxmaker on Ne00:", PrintToFile:=True, PrToFileName:=fname


--

Dave Peterson


--

Dave Peterson
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
2007 Excel Skipping Columns on printout preview and printing. fdlea Excel Worksheet Functions 0 April 16th 07 05:10 PM
Convert excel printout into electronic file rubaiyat543 Excel Discussion (Misc queries) 1 December 21st 05 03:48 PM
Vba printout Curtis[_6_] Excel Programming 2 October 7th 04 08:46 PM
Error 1004 in printing .ps (postscript) file from .xls file chemburkar[_2_] Excel Programming 2 February 5th 04 11:33 PM
PRINTOUT Wayne Blosat Excel Programming 0 August 27th 03 09:07 PM


All times are GMT +1. The time now is 05:34 PM.

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

About Us

"It's about Microsoft Excel"