ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Prinout function (https://www.excelbanter.com/excel-programming/349438-prinout-function.html)

Chris

Prinout function
 
Hello,

Trying to get a grasp of the VB stuff behind a spreadsheet. I am trying to
print the current spreadsheet so am trying to use the printout function.

I think I am using the [PrToFileName] property incorrectly but I do not know
what it expects. An example of what I have tried is:
me.PrintOut (,,,,,TRUE,,"U:\weeklyreport")

How do you define the file name to print the current spreadsheet to?

Leith Ross[_461_]

Prinout function
 

Hello Chris,

You should use the named arguments when calling the function...

me.PrintOut PrintToFile:="True", PrToFileName:="C:\My Documents\My
File.xls"

Just change the print to file name string to include the path (if
different from the current directory) and the file name.

Sincerely,
Leith Ross


--
Leith Ross
------------------------------------------------------------------------
Leith Ross's Profile: http://www.excelforum.com/member.php...o&userid=18465
View this thread: http://www.excelforum.com/showthread...hreadid=497789


Leith Ross[_460_]

Prinout function
 

Hello Chris,

You should use the named arguments when calling the function...

me.PrintOut PrintToFile:="True", PrToFileName:="C:\My Documents\My
File.xls"

Just change the print to file name string to include the path (if
different from the current directory) and the file name.

Sincerely,
Leith Ross


--
Leith Ross
------------------------------------------------------------------------
Leith Ross's Profile: http://www.excelforum.com/member.php...o&userid=18465
View this thread: http://www.excelforum.com/showthread...hreadid=497789


Chris

Prinout function
 
Thankyou for your help Leith,

Do you what format the output file is? I save it as an Excel file, but it
brings up warnings and is in an unrecorgnisable bunch or jargon.
If I do not save it as a xls, it is an unattributed file, and it doens't
work as a .doc either.

I wish to save it as a excel file.

Any tricks?

"Leith Ross" wrote:


Hello Chris,

You should use the named arguments when calling the function...

me.PrintOut PrintToFile:="True", PrToFileName:="C:\My Documents\My
File.xls"

Just change the print to file name string to include the path (if
different from the current directory) and the file name.

Sincerely,
Leith Ross


--
Leith Ross
------------------------------------------------------------------------
Leith Ross's Profile: http://www.excelforum.com/member.php...o&userid=18465
View this thread: http://www.excelforum.com/showthread...hreadid=497789



Cush

Prinout function
 
Chris

Try turning on your macro recorder, then printing or saving the file as you
wish.
Turn off the recorder and look at the code.

"Chris" wrote:

Thankyou for your help Leith,

Do you what format the output file is? I save it as an Excel file, but it
brings up warnings and is in an unrecorgnisable bunch or jargon.
If I do not save it as a xls, it is an unattributed file, and it doens't
work as a .doc either.

I wish to save it as a excel file.

Any tricks?

"Leith Ross" wrote:


Hello Chris,

You should use the named arguments when calling the function...

me.PrintOut PrintToFile:="True", PrToFileName:="C:\My Documents\My
File.xls"

Just change the print to file name string to include the path (if
different from the current directory) and the file name.

Sincerely,
Leith Ross


--
Leith Ross
------------------------------------------------------------------------
Leith Ross's Profile: http://www.excelforum.com/member.php...o&userid=18465
View this thread: http://www.excelforum.com/showthread...hreadid=497789




All times are GMT +1. The time now is 02:10 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com