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.
Bookmarks