I record me bringing a picture on a sheet to the front. The VBA looks like:
ActiveSheet.Shapes("ReactorC").Select
Selection.ShapeRange.ZOrder msoBringToFront
If I now run the VBA I get a compile error saying "msobringtofront" is not defined![]()
I record me bringing a picture on a sheet to the front. The VBA looks like:
ActiveSheet.Shapes("ReactorC").Select
Selection.ShapeRange.ZOrder msoBringToFront
If I now run the VBA I get a compile error saying "msobringtofront" is not defined![]()

This month, every Windows Secrets subscriber can download a one-chapter excerpt of Windows 7: The Missing Manual.Windows 7: The Missing Manual provides valuable information to help you overcome these difficulties in learning a new operating system. Subscribe today to download your free excerpt.
Make sure that you have a reference (in Tools | References... in the Visual Basic Editor) to the Microsoft Office n.0 Object Library where n is the internal version number of MS Office (9 for Office 2000, 10 for Office XP, 11 for Office 2003, 12 for Office 2007 and 14 for Office 2010)
[quote name='HansV' post='785115' date='17-Jul-2009 20:19']Make sure that you have a reference (in Tools | References... in the Visual Basic Editor) to the Microsoft Office n.0 Object Library where n is the internal version number of MS Office (9 for Office 2000, 10 for Office XP, 11 for Office 2003, 12 for Office 2007 and 14 for Office 2010)[/quote]
That helped partly (by the way, I use Office 2003 -and Communicator 2007- but I could only find an Microsoft Office 12.0 Object Library).
The construction as I tried it still didn't work:
ActiveSheet.Shapes("Reactor" & Typ).ShapeRange.ZOrder msoBringToFront
But this one (which was how it was recorded) does:
ActiveSheet.Shapes("Reactor" & Typ).Select
Selection.ShapeRange.ZOrder msoBringToFront
Seems the same to me but anyway... problem solved![]()
Shapes("Reactor" & Typ).ShapeRange is double - ShapeRange is not a property of a shape. You could have used
ActiveSheet.Shapes("Reactor" & Typ).ZOrder msoBringToFront
Installing Communicator 2007 probably replaced the Microsoft Office 11.0 Object Library with the 12.0 version.
[quote name='HansV' post='785115' date='17-Jul-2009 19:19']........... MS Office (9 for Office 2000, 10 for Office XP, 11 for Office 2003, 12 for Office 2007 and 14 for Office 2010)[/quote]
My apologies for butting in here, I was just wondering why the jump from 12 to 14? I have not seen any mention of this forthcoming version anywhere.
Because 13 is an unlucky number!
See Microsoft Office 2010 on Wikipedia.
I decided to skip 2007, not really wanting to tackle the new interface / ribbon. At some point though, I guess we will be forced that route. Thanks for the link.
Everything is going to be "ribbonized", not just Microsoft Office. In Windows 7, applications such as Notepad and Paint also use the ribbon interface.