Print Preview Macro

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a macro that ends with a print preview of the worksheet. I can not
seem to get the macro to record the close on the print preview. Any
suggestions - be careful, I am very new at this vb stuff.

Thanks,
 
I'm not sure I understand. If you Print Preview, I guess Excel assumes you
want to look at the preview. Hence you (or the user) determine when you've
seen enough.

As far as I know, this will have to be a manual intervention.

Regards
 
Trevor,

You understand correctly. It is a problem that I have for an Excel class and
the final step is to have the macro close the print preview. Being new to
this I thought I might not be understanding a step or something in creating
the macro.

Thanks for your patience and explaining.

Peter
 
When VBA issues the printpreview command, the code waits until the user
closes it manually. The only thing I could think of would be to do a
sendkeys just before doing printpreview (it that even works), but that would
immediately drop the window (if it works). Not much utility there. Sure
the assignment wants you to close the printpreview window (maybe a userform
or something that you called it from).
 
If you don't want it to do print preview, change the line that says Preview
= True to Preview = False
 
Tom & Jim,

Thanks for the suggestions. Like I mentioned to Trevor, I am just starting
out on this VBA thing and don't know if my continued head beating is worth
the 1 or 2 pts. to get it to run as requested in the assignment.

Thanks again,

Peter
 
Back
Top