Results 1 to 8 of 8

Thread: msobringtofront

  1. #1
    5 Star Lounger
    Join Date
    Jul 2001
    Location
    Terneuzen, Netherlands
    Posts
    895
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    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)

  3. #3
    5 Star Lounger
    Join Date
    Jul 2001
    Location
    Terneuzen, Netherlands
    Posts
    895
    Thanks
    0
    Thanked 0 Times in 0 Posts
    [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

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    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.

  5. #5
    Bronze Lounger
    Join Date
    Sep 2007
    Posts
    1,203
    Thanks
    0
    Thanked 0 Times in 0 Posts
    [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.

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    Because 13 is an unlucky number!

    See Microsoft Office 2010 on Wikipedia.

  7. #7
    Bronze Lounger
    Join Date
    Sep 2007
    Posts
    1,203
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.

  8. #8
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    Everything is going to be "ribbonized", not just Microsoft Office. In Windows 7, applications such as Notepad and Paint also use the ribbon interface.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •