+ Reply to Thread
Results 1 to 7 of 7

Range to Image with option for location to save

  1. #1
    Forum Contributor
    Join Date
    08-19-2009
    Location
    Netherlands, Amsterdam
    MS-Off Ver
    Excel 2010
    Posts
    585

    Range to Image with option for location to save

    Hello all,

    I use the following code to make a PDF file out of an excel range (print area).
    I'd like to do the same for an image file (Gif, Jpg or Png)

    Can this be done with a popup to select the location to save the image?

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Range to Image with option for location to save

    Please Login or Register  to view this content.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Forum Expert Kenneth Hobson's Avatar
    Join Date
    02-05-2007
    Location
    Tecumseh, OK
    MS-Off Ver
    Office 365, Win10Home
    Posts
    2,573

    Re: Range to Image with option for location to save

    For the pdf method:
    Please Login or Register  to view this content.
    For a 2nd way to do the "jpg" method:
    1. Put this into its own Module:
    Please Login or Register  to view this content.
    2. Similar to the pdf routine:
    Please Login or Register  to view this content.

  4. #4
    Forum Contributor
    Join Date
    08-19-2009
    Location
    Netherlands, Amsterdam
    MS-Off Ver
    Excel 2010
    Posts
    585

    Re: Range to Image with option for location to save

    Hello AlphaFrog,

    Yours seems to work almost, but the only thing it saves is a white/blank image.
    Attached Files Attached Files

  5. #5
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Range to Image with option for location to save

    It worked for me using your Book1.xlsm
    Not sure what to tell you.

    As a guess, try changing this line...
    .CopyPicture xlScreen, xlBitmap

  6. #6
    Forum Contributor
    Join Date
    08-19-2009
    Location
    Netherlands, Amsterdam
    MS-Off Ver
    Excel 2010
    Posts
    585
    That did not solve the problem unfortunately.
    Are there other ways?



    Quote Originally Posted by AlphaFrog View Post
    It worked for me using your Book1.xlsm
    Not sure what to tell you.

    As a guess, try changing this line...
    .CopyPicture xlScreen, xlBitmap

  7. #7
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Range to Image with option for location to save

    The only other way I know of is Ken's method. You'll have to work with him on that. I'm not familiar with it.

+ 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. [SOLVED] I need to save a cell range as an image
    By Normondo in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 09-27-2016, 07:34 PM
  2. VBA to save range as an image with specific file name?
    By mrbusto71 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-14-2016, 11:36 AM
  3. Replies: 3
    Last Post: 10-17-2015, 02:05 PM
  4. Image picture resize and save as on differen location
    By cemregunay in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-21-2014, 06:30 AM
  5. Userform image browse folder, show preview and save to range
    By Mehmet82 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-04-2013, 12:47 PM
  6. [SOLVED] macro to 'save as pdf' that prompts for filename, location AND only prints specified range
    By mtcolombo in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-06-2013, 01:49 PM
  7. [SOLVED] How to save cell location in range
    By twckfa16 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-11-2013, 09:39 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