Excel VBA: Export Multiple Userforms to PowerPoint or Excel as Screenshots

ajay_gajree

Well-known Member
Joined
Jul 16, 2011
Messages
518
Hi All

Can anyone point me in the right dircection to be able Export Multiple Userforms to PowerPoint or Excel as Screenshots using VBA?
If its possible!

I have the below code that will export the current Open Userform to an Excel Worksheet, but unsure how to adapt for a set of Userfoms

HTML:
Private Sub CommandButton1_Click()
     DoEvents
     keybd_event VK_LMENU, 0, KEYEVENTF_EXTENDEDKEY, 0
     keybd_event VK_SNAPSHOT, 0, KEYEVENTF_EXTENDEDKEY, 0
     keybd_event VK_SNAPSHOT, 0, KEYEVENTF_EXTENDEDKEY + _
         KEYEVENTF_KEYUP, 0
     keybd_event VK_LMENU, 0, KEYEVENTF_EXTENDEDKEY + _
         KEYEVENTF_KEYUP, 0
     DoEvents
     Workbooks.Add
     Application.Wait Now + TimeValue("00:00:01")
     ActiveSheet.PasteSpecial Format:="Bitmap"
     
     With ActiveSheet.PageSetup
         .CenterHorizontally = True
         .CenterVertically = True
         .Orientation = xlLandscape
         .PaperSize = xlPaperA4
         .BlackAndWhite = False
         .Zoom = False
         .FitToPagesWide = 1
         .FitToPagesTall = 1
     End With
     
    Application.Dialogs(xlDialogPrint).Show

End Sub
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
Hi


The example below exports to One Note. It is not suitable for many forms, as you will get a dialog box for each of them.


Code:
Sub Copy_Forms()
Dim obj As Object, i%, a, sp$
a = Array(1, 2, 5)                                      ' desired forms
sp = Application.ActivePrinter
Application.ActivePrinter = "Send To OneNote 2013 em nul:"
For i = LBound(a) To UBound(a)
    Set obj = VBA.UserForms.Add("UserForm" & a(i))
    obj.printform
Next
Application.ActivePrinter = sp                          ' restore settings
End Sub
 
Upvote 0

Forum statistics

Threads
1,223,723
Messages
6,174,113
Members
452,544
Latest member
aush

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