Exporting a Userform from Excel

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Pippy Parker
    New Member
    • Feb 2008
    • 1

    Exporting a Userform from Excel

    I've created a Userform within an Excel session which is populated by various pieces of info.

    What I'm looking to do is exported the Userform into a jpeg which I then can attach to a e - mail.

    I've tried going down the Alt - Print Screen route but I'm unable to get the SendKeys "%{PRTSC}" command to work.

    Any ideas

    Many thanks

    PP
  • kadghar
    Recognized Expert Top Contributor
    • Apr 2007
    • 1302

    #2
    i'd say with keybd_event can be done

    just declare it (above any other sub):

    [CODE=vb]Private Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, _
    ByVal bScan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long)[/CODE]

    and write something like this in the procedure where you want the print screen to occur
    [CODE=vb]
    keybd_event vbKeySnapshot, 0, 0, 0[/CODE]

    the constant is 44, so something like this will do too:
    [CODE=vb]
    keybd_event 44, 0, 0, 0[/CODE]

    HTH

    Comment

    Working...