Ozgrid Excel Help & Best Practices Forums


XL Templates | XL Add-ins | XL Training | XL Estimating | XL Scheduling | XL Recovery | XL Trading | XL Financial | XL Conversion | XL Charting


+ Reply to Thread
Results 1 to 2 of 2

Thread: Picture Copied as BitMap Ends Up As Metafile

  1. #1
    Join Date
    21st December 2005
    Posts
    15

    Picture Copied as BitMap Ends Up As Metafile


    Download Active Data For Excel > > DETAILS > >
    It appears that the VBA argument "xlBitmap" in Excel 2007 doesn't function as it should

    If I manually copy an embedded chart (or a range that includes data cells and an embedded chart) using Copy as Picture and select "As Shown on Screen" and "As Bitmap," the item copied to the clipboard is, indeed, a bitmap. If i perform the exact same action in VBA using
    Code:
    Selection.CopyPicture Appearance:=xlScreen, Format:=xlBitmap
    ,
    then the item copied to the clipboard in NOT a bitmap, but a metafile.

    I have macros that copy numerous charts and ranges as pictures and pastes them in powerpoint as pictures, but in XL07, the are always being copied as metafiles and ppt errors out if I use the
    Code:
    PPSlides.Shapes.PasteSpecial(ppPastebitmap)
    vba function.

    I would use the metafile format, but in Office 2007, they are a mess. I was hoping to copy and paste as bitmaps, but it's not working.

    Anyone else observed this bit of strangeness? Or is it just me?

  2. #2
    Join Date
    7th March 2003
    Location
    Essex, England
    Posts
    11,319

    Re: Picture Copied as BitMap Ends Up As Metafile


    Create Excel dashboards quickly with Plug-N-Play reports.
    For me in 2007 this code copies the chart as a bitmap and pastes into powerpoint as expected.

    [vba]Sub x()
    ' include reference to Powerpoint library 12

    Dim objPPT As PowerPoint.Application
    Dim objPPTPres As PowerPoint.Presentation
    Dim objPPTSld As PowerPoint.Slide

    Set objPPT = CreateObject("Powerpoint.application")
    objPPT.Visible = True
    Set objPPTPres = objPPT.presentations.Add
    Set objPPTSld = objPPTPres.Slides.Add(Index:=1, Layout:=ppLayoutText)

    ActiveSheet.Shapes(1).CopyPicture Appearance:=xlScreen, Format:=xlBitmap
    objPPTSld.Shapes.PasteSpecial ppPasteBitmap

    End Sub
    [/vba]

    Cheers
    Andy


+ Reply to Thread

Thread Information

Users Browsing this Thread

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

     

Possible Answers

  1. Inkpicture To Image/bitmap
    By Sp0rk in forum EXCEL HELP
    Replies: 2
    Last Post: May 7th, 2008, 16:17
  2. Copy Userform Bitmap
    By Cillies in forum EXCEL HELP
    Replies: 7
    Last Post: April 25th, 2007, 18:45
  3. Copy table to word as bitmap
    By Mer in forum EXCEL HELP
    Replies: 1
    Last Post: November 18th, 2005, 19:43
  4. Replies: 1
    Last Post: November 7th, 2005, 17:40
  5. Email : Outlook and Excel - Pasting in a metafile
    By Davo in forum Excel and/or Email Help
    Replies: 2
    Last Post: March 23rd, 2004, 23:36

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