I have created a module that runs a print screen command. The module runs great when I run it from the VBA window. But I do not know how to run the command from a button so that it can take a screen shot of the form.
I have created a module that runs a print screen command. The module runs great when I run it from the VBA window. But I do not know how to run the command from a button so that it can take a screen shot of the form.
If you go to the properties of the button on the form you can locate the On Click Event property. From there you can set the code to run when the button is clicked.
Not sure if it can reference the Private sub, so if you have strange errors that could be it.
Wish I had more for you, but I wanted to at least give you something until someone else can chime in. Good luck.
Create a Public function that does something simple and see if you can run it using the On Click Event of the button. If so, then it's possible that your Private function can't be called or it could be something else. Try moving your code into a Public function if possible.
Did you try to copy and paste the AltPrintScreen sub into the On Click sub you just created? Replace the "MsgBox" code with that and see if it works or returns errors.
You're welcome. If it's urgent I would recommend to create a new thread with a link to this one and explain it's urgency. This thread has a possibility of being buried.