PrintToFile OutputFilename problems

  • Thread starter Thread starter Brent Burkart
  • Start date Start date
B

Brent Burkart

I am trying to print to a file using the following line of code.

Selection.PrintOut PrintToFile:=True, OutputFilename:="c:\fundings.prn"

This bombs out with a error:

Run-time error '1004'
Application-defined or object-defined error

It works if I remove the "OutputFilename" parameter and enter manually at
the prompt, however, I want to automate the outputfilename parameter.

Has anyone seen this or do you have any ideas as to what I am doing wrong?

Thanks,
Brent
 
Try this Brent

Selection.PrintOut PrintToFile:=True, PrToFileName:="c:\fundings.prn"
 
My version of Excel (XL2000) doesn't have a OutputFilename parameter, it has
a PrToFileName parameter for the filename.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
That seems to work, however, its attempting to print to my default printer.
Should I have the parameter "ActivePrinter" set to anything?

Thanks,
Brent
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top