Need help with screen capture and outlook VBA script

  • I am trying to screen capture and send the image via Email. However, sometimes it works, and sometimes the screen capture ends up in the Excel WorkSheet.. Any idea one what I can do to make this more consistent?

  • 'The following seems to work consistently here :



    I suspect the primary edit involved the wait time.

  • 'The following seems to work consistently here :



    I suspect the primary edit involved the wait time.



    Were you able to just run mine without any error, or did you do something to it? I am comparing and not seeing any change.


    One of the biggest issues I am having is the consistency of it working..

    I wrote another script to avoid the sendkeys, and starting using the API way. And also, I am seeing if I can avoid pasting a screenshot and just attach the screen shot as a file.

  • Compare the code line by line. I commented out a few lines and corrected the TIME to "00:00:02" where noted.


    I ran the edited code without error and it consistently produce a copy of my desktop 10 times in a row ... whereas

    your original code would error out on the 3rd or 4th attempt.

  • Compare the code line by line. I commented out a few lines and corrected the TIME to "00:00:02" where noted.


    I ran the edited code without error and it consistently produce a copy of my desktop 10 times in a row ... whereas

    your original code would error out on the 3rd or 4th attempt.

    ahh!! thank you! When I get to work today, I will test this out for sure!

  • Compare the code line by line. I commented out a few lines and corrected the TIME to "00:00:02" where noted.


    I ran the edited code without error and it consistently produce a copy of my desktop 10 times in a row ... whereas

    your original code would error out on the 3rd or 4th attempt.

    Thank you Logit, I tested it work today and it worked as advertised!!

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!