Results 1 to 5 of 5

Error message - Method 'Select' of object 'Shape' failed

Threaded View

  1. #1
    Registered User
    Join Date
    10-05-2007
    Posts
    5

    Error message - Method 'Select' of object 'Shape' failed

    Hi all

    I am having what to me is a very strange problem since I've never had this issue before.

    Basically I have a calculator I've developed in Excel. This has some simple 'sheet switching' macro buttons.

    But for some reason, many of these buttons will not work (I get a runtime error) when the worksheet they are on is protected. If I unprotect the worksheets they work fine. The strange thing is that the other macros, and one 'sheet switching' macro work fine.

    The stranger thing is that the coding I have used is identical to that used for previous calculators.

    The following is the runtime error I get when selecting the macro button while the worksheet is protected:

    Run-time error '-2147467259 (80004005)':

    Method 'Select' of object 'Shape' failed


    The following is an example of one of the coding for one of the buttons:

    Sub Accept()
    '
    ' Accept Macro
    ' Macro recorded 26/09/2006 by Bscxc
    '
    
    '
        Sheet1.Unprotect Password:="carlo"
        ActiveSheet.Shapes("Button 21").Select
        Selection.Characters.Text = "Accept"
        With Selection.Characters(Start:=1, Length:=6).Font
            .Name = "Arial"
            .FontStyle = "Bold"
            .Size = 12
            .Strikethrough = False
            .Superscript = False
            .Subscript = False
            .OutlineFont = False
            .Shadow = False
            .Underline = xlUnderlineStyleNone
            .ColorIndex = xlAutomatic
        End With
        Sheets("Projector").Select
        Sheet1.Protect Password:="carlo"
        
    End Sub
    Any thoughts?

    Cdchi1

    Ps: Since this is my first post on this forum apologies in advance if I've submitted this to the wrong forum topic.
    Last edited by VBA Noob; 10-05-2007 at 02:52 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1