Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
msmichael
Creator
Creator

How to check if an object is invisible or not in VBScript

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

Labels (2)
1 Reply
Brett_Bleess
Former Employee
Former Employee

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

To help users find verified answers, please do not forget to use the "Accept as Solution" button on any post(s) that helped you resolve your problem or question.
I now work a compressed schedule, Tuesday, Wednesday and Thursday, so those will be the days I will reply to any follow-up posts.