ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   PrintOut_Method (https://www.excelbanter.com/excel-programming/295725-printout_method.html)

Shorty[_2_]

PrintOut_Method
 
I need some help printing to a file.

I am trying to understand code written by someone else
(who is not available). I am using the Immediate Window,
but this Window only holds a limited amount of
information. I have inserted "Stop" commands, but I've
gotten confused trying to follow the code's logic. I've
inserted a LOT of Debug.print commands. Now, I'd like to
just print all the information to a file and study the
file.

I've tried the following code:

ActiveSheet.PrintOut

and the worksheet is printed on the printer.

Then I tried the following code:

ActiveSheet.PrintOut printtofile:=True,
prtofilename:="Print Out Method Example.txt"

VBA created the fle, but I do not get anything from the
worksheet. I do get all of the driver setup information
for every printer on the LAN I have access to.

Does anyone have any suggestions?

Thanks in advance,

Shorty


Copy/Paste...?

PrintOut_Method
 
Whats wrong with copy & paste? You can copy the code and whats in the Immediate window and paste them to a text file.

Shorty[_2_]

PrintOut_Method
 
Thanks for the reply.

Copy & paste is one of the things I was doing. However,
the code has several layers of conditional logic (If,
ElseIf, etc). I had hoped by placing the Debug.print
statemments would allow me to follow what is going on.
The problem is the amount of data and calculation results
plus the jumping around in the ElseIfs. So, that is when
I went to the print to file. Problem is, it did not work.

Thanks again,

Jim
-----Original Message-----
Whats wrong with copy & paste? You can copy the code and

whats in the Immediate window and paste them to a text
file.
.


Vasant Nanavati

PrintOut_Method
 
Insted of using the Immediate Window for all the code, "step through" the
code (i.e., run the code using the F8 key. After each step you can review
the values of various variables.

--

Vasant


"Shorty" wrote in message
...
Thanks for the reply.

Copy & paste is one of the things I was doing. However,
the code has several layers of conditional logic (If,
ElseIf, etc). I had hoped by placing the Debug.print
statemments would allow me to follow what is going on.
The problem is the amount of data and calculation results
plus the jumping around in the ElseIfs. So, that is when
I went to the print to file. Problem is, it did not work.

Thanks again,

Jim
-----Original Message-----
Whats wrong with copy & paste? You can copy the code and

whats in the Immediate window and paste them to a text
file.
.





All times are GMT +1. The time now is 01:09 PM.

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