PC Review Forums Newsgroups Microsoft Word Microsoft Powerpoint PasteSpecial of Device Independent Bitmap with VBA in PP2007

Reply

PasteSpecial of Device Independent Bitmap with VBA in PP2007

 
Thread Tools Rate Thread
Old 06-09-2009, 10:30 AM   #1
wgk
Guest
 
Posts: n/a
Default PasteSpecial of Device Independent Bitmap with VBA in PP2007


Unfortunately I'm not able to paste a copied area (Cells + Shapes) from Excel
2007 as a Device Independet Bitmap (DIB) into PowerPoint with VB.

The VB PasteSpecial method of PowerPoint does not contain DIB as a
xlPasteType. With the existing types I get a result of poor resolution. If I
manually Cut and PasteSpecial, I can choose DIB and the quality of the
picture is almost equal to the original.

Coding:

With PPT
..Slides(i).Shapes.PasteSpecial DataType:=ppPastexxx 'xxx = any type won't
give a good result
With .Slides(i).Shapes(3)
..Left = 12.5
..Top = 83.5
..Height = .Height * 0.99
..Width = .Width * 0.99
End With
End With

In O2003 I had no problem, there I used DataType:=ppPasteMetafilePicture and
the result was sattisfying.
  Reply With Quote
Old 06-09-2009, 07:33 PM   #2
Edward
Guest
 
Posts: n/a
Default RE: PasteSpecial of Device Independent Bitmap with VBA in PP2007

In Excel 2007 copy as picture ( clcik on paste dropdown\last item "As
picture"\copy as picture\format bitmap) and in your PPVBA code use

ActivePresentation.Slides(1).Shapes.PasteSpecial ppPasteDefault
--
Best regards,
Edward


"wgk" wrote:

> Unfortunately I'm not able to paste a copied area (Cells + Shapes) from Excel
> 2007 as a Device Independet Bitmap (DIB) into PowerPoint with VB.
>
> The VB PasteSpecial method of PowerPoint does not contain DIB as a
> xlPasteType. With the existing types I get a result of poor resolution. If I
> manually Cut and PasteSpecial, I can choose DIB and the quality of the
> picture is almost equal to the original.
>
> Coding:
>
> With PPT
> .Slides(i).Shapes.PasteSpecial DataType:=ppPastexxx 'xxx = any type won't
> give a good result
> With .Slides(i).Shapes(3)
> .Left = 12.5
> .Top = 83.5
> .Height = .Height * 0.99
> .Width = .Width * 0.99
> End With
> End With
>
> In O2003 I had no problem, there I used DataType:=ppPasteMetafilePicture and
> the result was sattisfying.

  Reply With Quote
Old 09-09-2009, 02:31 PM   #3
wgk
Guest
 
Posts: n/a
Default RE: PasteSpecial of Device Independent Bitmap with VBA in PP2007

Doesn't work

Run-time error '-2147188160 (80048240)':
Shapes (unknown member) : Invalid request. Clipboard is empty or
contains data which may not be pasted here.

I think the problem is, that the data consists out of Excel cells and shapes.

And it is not logical to me, that I can not use the Device Independent
Bitmap as a DataType like it is possible when choosing paste special via the
menu.


"Edward" wrote:

> In Excel 2007 copy as picture ( clcik on paste dropdown\last item "As
> picture"\copy as picture\format bitmap) and in your PPVBA code use
>
> ActivePresentation.Slides(1).Shapes.PasteSpecial ppPasteDefault
> --
> Best regards,
> Edward
>
>
> "wgk" wrote:
>
> > Unfortunately I'm not able to paste a copied area (Cells + Shapes) from Excel
> > 2007 as a Device Independet Bitmap (DIB) into PowerPoint with VB.
> >
> > The VB PasteSpecial method of PowerPoint does not contain DIB as a
> > xlPasteType. With the existing types I get a result of poor resolution. If I
> > manually Cut and PasteSpecial, I can choose DIB and the quality of the
> > picture is almost equal to the original.
> >
> > Coding:
> >
> > With PPT
> > .Slides(i).Shapes.PasteSpecial DataType:=ppPastexxx 'xxx = any type won't
> > give a good result
> > With .Slides(i).Shapes(3)
> > .Left = 12.5
> > .Top = 83.5
> > .Height = .Height * 0.99
> > .Width = .Width * 0.99
> > End With
> > End With
> >
> > In O2003 I had no problem, there I used DataType:=ppPasteMetafilePicture and
> > the result was sattisfying.

  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off