N
Nickis
Hi,
To set the stage - I dabble in writing VBA macros in Excel and seem to
muddle through okay using online and book reference. However, I'm new to
creating macros in Powerpoint and it's not nearly so clear cut.
I'm using Powerpoint 2003 and VBA. I found the following code on this site
to create a name for a shape immediately as it's added to a slide, and it
works great! How do I modify this code to immediately name a shape that's
being COPIED into a slide from Excel? I've tried all sorts of variables that
I could piece together but nothing seems to work. I'm copying in a 3x25
table that I will in turn be taking data from and pasting a different slide
in the same presentation.
Sub addashape()
Dim oshp As Shape 'object variable
'set oshp to added shape
Set oshp = ActivePresentation.Slides(1).Shapes _
..AddShape(msoShapeRectangle, 10, 0, 100, 58)
'use oshp as reference
With oshp
..Name = "myshape"
'any other properties here
End With
End Sub
Thanks for any help!
Nicki
To set the stage - I dabble in writing VBA macros in Excel and seem to
muddle through okay using online and book reference. However, I'm new to
creating macros in Powerpoint and it's not nearly so clear cut.
I'm using Powerpoint 2003 and VBA. I found the following code on this site
to create a name for a shape immediately as it's added to a slide, and it
works great! How do I modify this code to immediately name a shape that's
being COPIED into a slide from Excel? I've tried all sorts of variables that
I could piece together but nothing seems to work. I'm copying in a 3x25
table that I will in turn be taking data from and pasting a different slide
in the same presentation.
Sub addashape()
Dim oshp As Shape 'object variable
'set oshp to added shape
Set oshp = ActivePresentation.Slides(1).Shapes _
..AddShape(msoShapeRectangle, 10, 0, 100, 58)
'use oshp as reference
With oshp
..Name = "myshape"
'any other properties here
End With
End Sub
Thanks for any help!
Nicki