RE: COMException while formatting PowerPoint shapes



Hi Mike,

Based on my test, it seems that the VBA code did not run well at my side.
So far we summarized your scenario as below.

In your PPT there is a Table which is a Shape.

Use the code below, we first run Test Macro to get the Shape r eference and
run Test2 to use the Reference. That works at my side.

Dim o As Shape
Sub Test()
'Set o = Application.ActivePresentation.Slides(1).Shapes
Set o = ActiveWindow.Selection.ShapeRange(1)
MsgBox o.Name
End Sub


Sub Test2()
MsgBox o.Name
End Sub


Also as I mentioned before, you may try to use the
ActiveWindow.Selection.ShapeRange(1) to reference to the shape again but
not use the reference.
Even use the Application.ActivePresentation.Slides(1).Shapes collection to
see if that shape existed in the collection when the second reference
attempt.


Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

.



Relevant Pages

  • Re: Referencing Dynamic Range
    ... Sub copyrange() ... MsgBox ... How do I reference an ActiveCell? ... active cell instead of specifying a cell below? ...
    (microsoft.public.excel.programming)
  • RE: Referencing Dynamic Range
    ... Sub copyrange() ... MsgBox ... How do I reference an ActiveCell? ... active cell instead of specifying a cell below? ...
    (microsoft.public.excel.programming)
  • Re: How to refer to a class property while in that class. (Solved)
    ... MsgBox c1.Token ... Class dataProc ... Public Sub DoMe() ... in VB to reference a VB Form from within itself ...
    (microsoft.public.scripting.vbscript)
  • Re: Access-Forms-VB links
    ... All VBA code is either a Sub or a Function. ... A Form or Report Module belongs to the Form or Report object. ... Code in any module can reference code in any other module based on the Scope ...
    (microsoft.public.access.formscoding)
  • RE: REPOST: Get URL...
    ... workbook instance. ... Here is a VBA code for your reference, but the Addin will do the same ... Sub Test() ...
    (microsoft.public.office.developer.com.add_ins)