Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I'm writing a VBScript to export all visible objects in a sheet to PowerPoint slide.
I use ActiveDocument.ActiveSheet.GetSheetObjects to get all objects in the sheet and copy them to a slide one by one. But I want to skip the objects that are invisible, because seems to me the script does not handle invisible object correctly..
Objects = ActiveDocument.ActiveSheet.GetSheetObjects
SET PPSlide = PPPres.Slides.Add(PPSlideNo, 12)
For i = lBound(Objects) To uBound(Objects)
set obj = sht.SheetObjects(i)
ActiveDocument.GetApplication.WaitForIdle
'------------ Get Chart Object and Export to PPT Slide ----
obj.CopyBitmapToClipboard
'------------ Configure Object Position and Size ----------
SET Shape = PPSlide.Shapes.Paste
Shape.LockAspectRatio = msoTRUE
Shape.LEFT = obj.getRect.left * ratioW
Shape.Top = obj.getRect.top * ratioH
r = obj.getRect.width / printW * slideW / Shape.width
Shape.ScaleWidth r , msoTrue 'relative to original size
Shape.ScaleHeight r , msoTrue 'relative to original size
next
The problem is if an object is invisible, the script simply copies the previous visible object again and paste it to the slide..
Thanks,
Meng
Best I can do for you is the attached API Guide app, which has all the available calls, hopefully you can find what you need there.
Regards,
Brett