Page Setup For Printing VBA Form

pistonbroke

New Member
Joined
Jan 15, 2003
Messages
49
I want to print a VBA form as it appears on the screen, "formname.PrintForm" works fine, except i need to temporarily force a LANDSCAPE orientation (others will print the form, and they generally have PORTRAIT as the printer default layout).

Is there something similar to this activesheet setup, that will work to print a VBA form ? This code doesn't seem to affect the PrintForm command.

With ActiveSheet.PageSetup
.Orientation = xlLandscape
End With

Thanks, Kevin
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
Diablo - thanks. How do i force that line in the code of my "Print Form" button?

Private Sub cbPrint_Form_Click()
fm_Select_Find_Criteria.PrintForm
End Sub


Thanks again, Kevin
 
Upvote 0
Diablo, thanks, but that doesn't work to change the print layout for the VBA Form itself (which is what i am printing), since i'm not actually printing a worksheet.

The actual VBA form doen't appear to have properties relating to print orientation, paper size etc. So i was hoping to be able to temporarily set the default printer orientation in code instead ?

Thanks, Kevin
 
Upvote 0

Forum statistics

Threads
1,214,786
Messages
6,121,548
Members
449,038
Latest member
Guest1337

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top