Sorry to be so dumb, but I still get an error. I am testing it that these is
an object that I copied to a clip board. This is the code:
Do Until T.EOF
Forms![GenPPT]![OLEFile].Action = acOLECopy
oPres.PageSetup.SlideHeight = (8.5 * 1440) / 20
Set oSI = oPres.Slides.Add(oPres.Slides.Count + 1, ppLayoutBlank)
Call oSI.Shapes.PasteSpecial(DataType:=ppPastePNG, Link:=msoFalse)
'oPres.Slides.Add(oPres.Slides.,Count + 1,
ppLayoutBlank).Shapes.Paste
oPres.Slides.Add(oPres.Slides.Count + 1,
ppLayoutBlank).Shapes.PasteSpecial Link:=msoTrue
I did an OLECopy from a access table and I did the PasteSpecial with the
extact commands you posted. I get the following error:
"Shapes (unknown member) invalid request. The specified data type is
unavailable.
Probably because you're not specifying a data type and the default data type,
whatever it might be, is not on the clipboard OR is not a type that can be linked.
I ran it with the command
'oPres.Slides.Add(oPres.Slides.,Count + 1,
ppLayoutBlank).Shapes.Paste
with out it being commented out and it generated a power point for me.
When I commend out the Paste and use the PasteSpecial it didn't work. If
it work for the Paste, it must have something in the clip board.
I am usng Power Point 2002 sp3.
What am I doing wrong???
Not reading my replies, I guess? ;-)
Again, do it manually or run your access code to put data on the clipboard. Then
in PPT, choose Edit, Paste Special and look at what's available. If you're asking
PPT to PasteSpecial a format that isn't there, you'll get an error. The very one
you ARE getting.
Thanks,
Gary
Steve Rindsberg said:
I do see PasteSpecial in 2002, but it doesn't work there.
I had a chance to fire up 2002 and it does seem to work:
Dim oSl as Slide
Set oSl = oPres.Slides.Add(oPres.Slides.Count + 1, ppLayoutBlank)
call oSl.Shapes.PasteSpecial(DataType:=ppPastePNG, Link:=msoFalse)
This works, assuming there's something on the clipboard in the first place.
If there's not, or if the requested data type isn't on the clipboard, you'll get an
error.
To test this, first copy your content to the clipboard manually, then use Edit, Paste
Special and look at the list of available paste options; if what you want isn't there,
it won't be available to VBA either.
Slides.Add(oPres.Slides.Count + 1,
ppLayoutBlank).Shapes.PasteSpecial Link:=msoTrue
I tried this in 2002, and the PasteSpecial Link:=msoTrue didn't give any
compile error and gives a execution erorr.
Can I just that its not really available in PPT 2002 either???
Thanks,
Gary
: