PDA

Click to See Complete Forum and Search --> : Printout from excel without common dialog


lennart
Feb 17th, 2004, 07:43 AM
I want to produce a macro in excel where I do a print (to file) and hardcode the filename - and not get any common dialog window.
SOmeone who knows how to do that??

lennart
Feb 19th, 2004, 01:56 AM
Is there noone who can tell how to supress the common dialog windows when printing from macro in excel?

TheFIDDLER
Feb 19th, 2004, 09:31 PM
Depends on which version of Excel you are using.

This is from the Excel Help File.

In Excel 97
PrintToFile Optional Variant. True to print to a file. Microsoft Excel prompts the user to enter the name of the output file. There's no way to specify the name of the output file from Visual Basic.


In Excel XP
expression.PrintOut(From, To, Copies, Preview, ActivePrinter, PrintToFile, Collate, PrToFileName)

PrToFileName Optional Variant. If PrintToFile is set to True, this argument specifies the name of the file you want to print to.