Try this in Excel (VBA gurus please)

  • Deleted user 24 August 2012 18:34:51
    I'm getting an error in Excel 2003. To see if you get the same do the following:

    1. Create an autoshape in Excel, say an oval.
    2. Turn on the macro recorder.
    3. Click on the Oval to select it.
    4. Stop the macro recorder.
    5. Run that code.

    I get a run time error and have no idea of how to fix it. Anyone?
  • X201 24 Aug 2012 18:37:56 18,459 posts
    Seen 12 minutes ago
    Registered 12 years ago
    Haven't got Excel at home.

    Please call the help desk on Tuesday when normal service will be resumed
  • pauleyc 24 Aug 2012 18:56:16 4,548 posts
    Seen 10 hours ago
    Registered 16 years ago
    Strange, worked for me.

    Have a look at the code (Tools->Macro->Macros..., then highlight the one you created and select Edit). It should be similar to this:

    Sub Macro1()
    ' blah

    ActiveSheet.Shapes("Oval 1" ).Select
    End Sub

    Edited by pauleyc at 18:56:28 24-08-2012
  • Deleted user 24 August 2012 18:58:14
    Yeah, that's the code, but it doesn't work for me. I get:

    Run-time error '-2147024809 (80070057)'
    The item with the specified name wasn't found

    Stumped. Excel 2003?
  • Deleted user 24 August 2012 18:58:30
    Thanks for trying it and posting results btw.
  • pauleyc 24 Aug 2012 19:02:14 4,548 posts
    Seen 10 hours ago
    Registered 16 years ago
    Weird. Did you perhaps rename the autoshape? If you select it, does it say 'Oval 1' in the field left of the formula bar?
  • neilka 24 Aug 2012 19:08:20 21,205 posts
    Seen 4 hours ago
    Registered 13 years ago
    Have you tried using a circle and making it narrower?
  • Deleted user 24 August 2012 19:15:24
    No renaming, the name is fine.
  • Deleted user 24 August 2012 19:17:27
    Tried it in Office 2010 and works fine. ARGH.
Log in or register to reply

Sometimes posts may contain links to online retail stores. If you click on one and make a purchase we may receive a small commission. For more information, go here.