+ Reply to Thread
Results 1 to 6 of 6

Saving a screen shot of a range

  1. #1
    Registered User
    Join Date
    12-13-2014
    Location
    Boston, MA
    MS-Off Ver
    MS Office 2013
    Posts
    53

    Saving a screen shot of a range

    Hey guys,

    I'm looking for a little help constructing a macro to save a screenshot of range ("A1:I35") as a jpg file. I've tried converting the active area into a table and saving this without much luck. Any help would be appreciated!

  2. #2
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: Saving a screen shot of a range

    How about:

    Please Login or Register  to view this content.
    Make Mom proud: Add to my reputation if I helped out!

    Make the Moderators happy: Mark the Thread as Solved if your question was answered!

  3. #3
    Registered User
    Join Date
    12-13-2014
    Location
    Boston, MA
    MS-Off Ver
    MS Office 2013
    Posts
    53

    Re: Saving a screen shot of a range

    This copies the selected range but the output ends up in the coding and not on paint. I would still need to be able to save the paint file as a jpg file as well.

  4. #4
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: Saving a screen shot of a range

    Maybe you left your focus in VB Editor. Each of my runs pasted correctly to MSPaint and left open a dialogue to choose the filename.

    Try increasing paste delay to 3 seconds.

    Here it is again with more SendKeys, going through naming the file and changing the type to JPEG.

    Please Login or Register  to view this content.
    Last edited by daffodil11; 05-14-2015 at 06:20 PM.

  5. #5
    Registered User
    Join Date
    12-13-2014
    Location
    Boston, MA
    MS-Off Ver
    MS Office 2013
    Posts
    53

    Re: Saving a screen shot of a range

    This works perfectly! Reputation added Out of curiosity, did you use the macro recorder to do this?

  6. #6
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: Saving a screen shot of a range

    Nope!

    I began with a subroutine I wrote that copies a range of cells and opens an email to paste it into.

    I did a little research to work out the Shell command.
    The hardest part was figuring out that I needed to removed the filepath and only include the executable.

    From there I just looked at Paint and figured out the key presses required to Save As, and then navigate the menu to change file type.

    SendKeys are the same as the operating system pushing keys for you and are great for interacting with non-VB interfaces such as AS400.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 7
    Last Post: 10-29-2014, 03:41 AM
  2. Screen Shot Paste
    By keen2xl in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-11-2013, 07:43 AM
  3. How to take screenshot in excel to use pictue in vb
    By sugee in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-30-2013, 03:54 AM
  4. Screen Shot Question
    By potatomice in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-17-2012, 09:53 AM
  5. Screen Shot
    By CarlainChicago in forum Excel General
    Replies: 1
    Last Post: 09-23-2010, 05:47 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1