Jamie Garroch (MVP)
asked on
VBA Type Mismatch with Microsoft Office PowerPoint SmartArt node shape
I have a simple routine that loops through the nodes of a SmartArt object that starts like this:
The last line generates a Type Mismatch error but when I change the first Dim statement to be non-explicit:
And then examine the data type by inserting a breakpoint and using this in the immediate window:
It returns "Shape".
Why is this a mismatch?!!!
Everything works as expected (except IntelliSense) when the variable is not defined as shape but this is really bugging me.
Function LoopSmartArt(oShp as Shape)
Dim oShpNode As Shape
Dim oNode As SmartArtNode
With oShp
For Each oNode In .SmartArt.AllNodes
For Each oShpNode In oNode.Shapes
The last line generates a Type Mismatch error but when I change the first Dim statement to be non-explicit:
Dim oShpNode
And then examine the data type by inserting a breakpoint and using this in the immediate window:
?TypeName (oShpNode)
It returns "Shape".
Why is this a mismatch?!!!
Everything works as expected (except IntelliSense) when the variable is not defined as shape but this is really bugging me.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER