Wow thanks guys! I'm most experienced with C-family languages and while I spent a lot of time in VB6 back in the day, I've done bugger-all VBA and I find it the most different language I've come across (it's been about 13 years since I touched VB).
I'm essentially trying to loop through all the Slides in a PPT presentation, then loop through all the Shapes on the Slide, and create an instance of my class using the information derived from the Shapes.
I would have expected this to work:
but VBA doesnt seem to create a NEW OB3Slide each time, it keeps the old one. It doesn't matter if I put the "Dim oSlide as OB3Slide" line before the loop, or "Dim oSlide as new OB3Slide" inside the first loop. It's damn annoying, and goes against everything I've learnt about programming... guess that's what you get for using a non-OO language. I wish MS would give us something better than VB6 to use behind Office.
Kyle123: Thanks for pointing out the missing "set", but it didnt change a thing However, I'll now go and change my array to a collection - I wasn't aware such a thing existed.
TMShucks: Scope will determine when VBA will use the Collection.Add() method versus my Module1.add() method.
Thank you all very much
Bookmarks