Page 1 of 2 12 LastLast
Results 1 to 15 of 16
  1. #1
    WS Lounge VIP
    Join Date
    Mar 2002
    Location
    Newcazzle, UK
    Posts
    2,826
    Thanks
    136
    Thanked 482 Times in 459 Posts

    picture scaling (Excel2000)

    Hi

    I'm trying to use a bit of code to capture a selected range of data to the clipboard, moving to a different workbook where I want to paste the copied data as an 'image'.
    I want to shrink the picture by 50%.

    The code runs something like:

    [namedrange].CopyPicture Appearance:=xlScreen, Format:=xlBitmap

    Workbooks(differentbook).Activate
    Range(here).Select
    ActiveSheet.Paste

    'reduce picture by 50%..
    Selection.ShapeRange.ScaleWidth 0.5, msoFalse, msoScaleFromTopLeft
    Selection.ShapeRange.ScaleHeight 0.5, msoFalse, msoScaleFromTopLeft


    For some reason, I can't seem to get the full extent of the [namedrange] in the final shrunken image.
    (i.e. its seems to 'chop off' beyond a certain number of columns in my [namedrange] )

    I've tried various combinations including:
    [namedrange].CopyPicture Appearance:=xlPrinter, Format:=xlPicture


    Any suggestions???

    zeddy

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: picture scaling (Excel2000)

    Could you be more specific? What is the "certain number of columns"?

  3. #3
    WS Lounge VIP
    Join Date
    Mar 2002
    Location
    Newcazzle, UK
    Posts
    2,826
    Thanks
    136
    Thanked 482 Times in 459 Posts

    Re: picture scaling (Excel2000)

    Hi Hans

    The data range I want to capture and scale has a variable number of columns.
    (approx 24 columns, width 8 each)
    It seems to truncate at a maximum number of columns.

    I can manually copy the large column range block to the clipboard, go into Word, set a page to landscape, and use pastespecial to put the full contents there as a bitmap.
    Can't seem to do the same thing if I use another Excel workbook as my destination instead of Word.

    zeddy

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: picture scaling (Excel2000)

    When I try your code, it works correctly to well beyond 60 columns. Could you attach a workbook that demonstrates the problem?

  5. #5
    WS Lounge VIP
    Join Date
    Mar 2002
    Location
    Newcazzle, UK
    Posts
    2,826
    Thanks
    136
    Thanked 482 Times in 459 Posts

    Re: picture scaling (Excel2000)

    Hi Hans

    I cobbled together a quick example in the attached file.
    The data range is named [block1]

    zeddy

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: picture scaling (Excel2000)

    Am I overlooking something? I have attached the result of clicking the button.

  7. #7
    WS Lounge VIP
    Join Date
    Mar 2002
    Location
    Newcazzle, UK
    Posts
    2,826
    Thanks
    136
    Thanked 482 Times in 459 Posts

    Re: picture scaling (Excel2000)

    You are not overlooking something.
    You got what I want.
    I didn't.
    When I click the button I don't get all the columns.
    I have attached my result of clicking the button.

    zeddy

  8. #8
    Uranium Lounger
    Join Date
    Jan 2001
    Location
    South Carolina, USA
    Posts
    7,295
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: picture scaling (Excel2000)

    Hans: I get the same result as zeddy. I seem to remember having a similar problem on something I was trying to do quite a while back, and that it was a result of a bug in whatever version I was running at that time. The bug may have been fixed in the version you are running.
    Legare Coleman

  9. #9
    WS Lounge VIP
    Join Date
    Mar 2002
    Location
    Newcazzle, UK
    Posts
    2,826
    Thanks
    136
    Thanked 482 Times in 459 Posts

    Re: picture scaling (Excel2000)

    This may be an interesting line of pursuit.

    What version are you using Hans?

    I've got Excel 2000, Excel2002, Excel2003, and Excel2007 here (various SPs)

    zeddy

  10. #10
    Uranium Lounger
    Join Date
    Jan 2001
    Location
    South Carolina, USA
    Posts
    7,295
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: picture scaling (Excel2000)

    I have XL2K here, the same as you posted the question for. Since you have the others, have you tried it on those? I think Hans has XL2003.
    Legare Coleman

  11. #11
    WS Lounge VIP
    Join Date
    Mar 2002
    Location
    Newcazzle, UK
    Posts
    2,826
    Thanks
    136
    Thanked 482 Times in 459 Posts

    Re: picture scaling (Excel2000)

    Hi Legare

    Well you have all the answers!
    Yes indeedy. It works in Excel2003.
    But not apparently in Excel2000, which is what I was in when I tried it, hence the post.

    Thanks a million. I thought it was just me.

    zeddy

  12. #12
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: picture scaling (Excel2000)

    I used Excel 2002 SP-3.

  13. #13
    WS Lounge VIP
    Join Date
    Mar 2002
    Location
    Newcazzle, UK
    Posts
    2,826
    Thanks
    136
    Thanked 482 Times in 459 Posts

    Re: picture scaling (Excel2000)

    Many thanks to all for helping me get this resolved.

    ..now which is better
    Format:=xlPicture
    or
    Format:=xlBitmap

    ..what would you use?

    zeddy

  14. #14
    WS Lounge VIP
    Join Date
    Mar 2002
    Location
    Newcazzle, UK
    Posts
    2,826
    Thanks
    136
    Thanked 482 Times in 459 Posts

    Re: picture scaling (Excel2000)

    did you mean
    so I'd choose Appearance:=xlPrinter , Format:=xlPicture

    zeddy

  15. #15
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: picture scaling (Excel2000)

    If you want to be able to scale the picture later, Format:=xlPicture is far preferable, for Format:=xlBitmap leads to pixelation if you scale it.

    Appearance:=xlScreen leads to a larger file size than Appearance:=xlPrinter without a significant increase in quality, so I'd choose Appearance:=xlPrinter, Format:=xlPicture

    (Edited by HansV to correct error)

Page 1 of 2 12 LastLast

Posting Permissions

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