I have a simple routine that loops through the nodes of a SmartArt object that starts like this:
Function LoopSmartArt(oShp as Shape)
Dim oShpNode As Shape
Dim oNode As SmartArtNode
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:
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.