PrintOut_Method

S

Shorty

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
 
G

Guest

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

Shorty

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.
 
V

Vasant Nanavati

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.
 

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

Top