ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Print Preview Macro (https://www.excelbanter.com/excel-programming/375671-print-preview-macro.html)

pb

Print Preview Macro
 
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,

Trevor Shuttleworth

Print Preview Macro
 
sheets(1).printpreview
activesheet.printpreview

Regards

Trevor


"Pb" wrote in message
...
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,




pb

Print Preview Macro
 
Thanks Trevor,

But it still will not "close" after the preview.

"Trevor Shuttleworth" wrote:

sheets(1).printpreview
activesheet.printpreview

Regards

Trevor


"Pb" wrote in message
...
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,





Trevor Shuttleworth

Print Preview Macro
 
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


"Pb" wrote in message
...
Thanks Trevor,

But it still will not "close" after the preview.

"Trevor Shuttleworth" wrote:

sheets(1).printpreview
activesheet.printpreview

Regards

Trevor


"Pb" wrote in message
...
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,







pb

Print Preview Macro
 
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

"Trevor Shuttleworth" wrote:

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


"Pb" wrote in message
...
Thanks Trevor,

But it still will not "close" after the preview.

"Trevor Shuttleworth" wrote:

sheets(1).printpreview
activesheet.printpreview

Regards

Trevor


"Pb" wrote in message
...
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,







Tom Ogilvy

Print Preview Macro
 
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).

--
Regards,
Tom Ogilvy


"Pb" wrote in message
...
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

"Trevor Shuttleworth" wrote:

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


"Pb" wrote in message
...
Thanks Trevor,

But it still will not "close" after the preview.

"Trevor Shuttleworth" wrote:

sheets(1).printpreview
activesheet.printpreview

Regards

Trevor


"Pb" wrote in message
...
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,









Jim[_22_]

Print Preview Macro
 
If you don't want it to do print preview, change the line that says Preview
= True to Preview = False

"Pb" wrote in message
...
Thanks Trevor,

But it still will not "close" after the preview.

"Trevor Shuttleworth" wrote:

sheets(1).printpreview
activesheet.printpreview

Regards

Trevor


"Pb" wrote in message
...
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,







pb

Print Preview Macro
 
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

"Jim" wrote:

If you don't want it to do print preview, change the line that says Preview
= True to Preview = False

"Pb" wrote in message
...
Thanks Trevor,

But it still will not "close" after the preview.

"Trevor Shuttleworth" wrote:

sheets(1).printpreview
activesheet.printpreview

Regards

Trevor


"Pb" wrote in message
...
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,








All times are GMT +1. The time now is 11:43 AM.

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