ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   print preview (https://www.excelbanter.com/excel-programming/367510-print-preview.html)

borg

print preview
 
Hi,

I have a problem with .printpreview after a userform is displayed. The
following code displays userform1 but does not show the printpreview of
worksheet1. --Thanks!


Sub test()
With UserForm1
.Width = Application.Width
.Height = Application.Height
.Show vbModeless
End With
Worksheets(1).PrintPreview
End Sub


NickHK

print preview
 
It's a bit pointless covering the whole area in a userform, as you cannot
interact with the app under it.
Also, it seems that userform do not interact well in .PrintPreview.

What are you trying to achieve ?

NickHK

"borg" wrote in message
...
Hi,

I have a problem with .printpreview after a userform is displayed. The
following code displays userform1 but does not show the printpreview of
worksheet1. --Thanks!


Sub test()
With UserForm1
.Width = Application.Width
.Height = Application.Height
.Show vbModeless
End With
Worksheets(1).PrintPreview
End Sub




[email protected]

print preview
 
Hi,

I think you should hide or unload the userform before .printpreview
and load or show it again after .printpreview

like

Userform1.hide
activesheet.printpreview
Userform1.show

thanks,
halim

borg menuliskan:
Hi,

I have a problem with .printpreview after a userform is displayed. The
following code displays userform1 but does not show the printpreview of
worksheet1. --Thanks!


Sub test()
With UserForm1
.Width = Application.Width
.Height = Application.Height
.Show vbModeless
End With
Worksheets(1).PrintPreview
End Sub



borg

print preview
 
Thank you so much!!



" wrote:

Hi,

I think you should hide or unload the userform before .printpreview
and load or show it again after .printpreview

like

Userform1.hide
activesheet.printpreview
Userform1.show

thanks,
halim

borg menuliskan:
Hi,

I have a problem with .printpreview after a userform is displayed. The
following code displays userform1 but does not show the printpreview of
worksheet1. --Thanks!


Sub test()
With UserForm1
.Width = Application.Width
.Height = Application.Height
.Show vbModeless
End With
Worksheets(1).PrintPreview
End Sub





All times are GMT +1. The time now is 01:18 AM.

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