在Powerpoint中用vbscript如何调整embedded的OLE xls对象的显示范围?

我的问题是,我正在将xls表单合并到PowerPoint演示文稿中。 有时最后3列在对象中不可见。 他们在那里,如果你双击该对象,然后在Excel中查看它。 我想在VBScript的方式来设置embedded对象图标应该显示的范围。 (可以通过双击对象进行手动操作,双击后拖动位于对象两边中间的小黑方块。)

我一直在尝试2天来解决这个小问题。 我已经尝试OLEFormat和这个http://msofficeautomation.wordpress.com/2012/06/11/add-excel-sheet-via-addoleobject-into-powerpoint/没有任何运气。 我试图在Word中录制一个macros,因为我没有在ppt中的loggingfunction,但是当录制一个macros时,你不能重新定义在这个对象中显示的范围。 🙁

我附上一个小例子,在powerpoint本身中添加一个名为C:\ temp \ addOLEObject_problem \ Book1.xlsx的xlsx文件

Sub AddObject() Set PPSlide = ActivePresentation.Slides.Add(ActivePresentation.Slides.Count + 1, 16) Set objShapeOLE = PPSlide.Shapes.AddOLEObject(0, 0, , , ,"C:\temp\addOLEObject_problem\Book1.xlsx", False) ' Set objShapeOLE = PPSlide.Shapes.AddOLEObject(0, 0, , , , ".\Book1.xlsx", False) ' Resize to fill the slide ' ******check if width or height of the picture is larger than the slide******* defaultWidth = objShapeOLE.Width defaultHeight = objShapeOLE.Height wRatio = PPSlide.Master.Width / objShapeOLE.Width 'Will be smaller and smaller the more resizing that is needed of the larger picture hRatio = PPSlide.Master.Height / objShapeOLE.Height ' if >1 no resize is needed resizeRatio = 1 If wRatio < hRatio Then resizeRatio = wRatio Else resizeRatio = hRatio End If objShapeOLE.Width = resizeRatio * objShapeOLE.Width '????How to set the range being displayed in the object????? End Sub 

Brgds Andy