Log in

View Full Version : VBA ungroup Shape (SmartArt)



michael24B
02-22-2017, 03:33 AM
Does anyone know how to ungroup SmartArt element via VBA?



Sub UngroupSmartArt()

Dim shapeWithSmartArt As Shape
Set shapeWithSmartArt = ActivePresentation.Slides(2).Shapes(2)

shapeWithSmartArt.Ungroup

End Sub


I get an error for this code: "This member can only be accessed for a group."

It doesn't make any sense to me, because it's easily possible to do it in powerpoint itself (Right click on SmartArt -> Group -> Ungroup). It's driving me nuts :dunno


Can anyone help me with ungrouping SmartArt element/shape?

I also took a look on similar question on stackoverflow (stackoverflow.com/questions/26977130/cannot-ungroup-a-powerpoint-smartart-shape), but it doesn't work properly, because ungrouped result is different in comparison to the one made via powerpoint itself.


Please help me out. I would really appreciate any help!

John Wilson
03-02-2017, 07:42 AM
Before you spend time on this it looks like a cross post and the other post has an answer (or two)

Cross Post (https://answers.microsoft.com/en-us/msoffice/forum/msoffice_powerpoint-mso_other/vba-ungroup-shape-smartart-in-powerpoint/f093b76e-328d-408b-bdfb-05ccbf5f6c80)

Paul_Hossler
03-02-2017, 06:23 PM
@michael24B (http://www.vbaexpress.com/forum/member.php?63067-michael24B)

@michael24B - welcome to the forums

Please read the FAQ, esp the one about multi-posting

http://www.vbaexpress.com/forum/faq.php?faq=new_faq_item#faq_new_faq_item3, and the link http://www.excelguru.ca/node/7


I added the [CODE] tags around your macro, so next time if your click the [#] icon, you can get the [ CODE ] ... [ \CODE ] tags to paste your macro between