Run-time error opening an excel workbook

When I open a particular Excel workbook it gives me a
run-time error '-2147024809 (80070057)':
Requested shapes are locked for selection.
then when i click debug it take me to the following line of code in the sub that I have attached below.

 ActiveSheet.Shapes("Text Box 3").Select




Sub Auto_Open()

    Dim Summary_Text As String
    Dim Temp As String
    Dim count_text As Integer
    
    Worksheets("Summary").Select
    Summary_Text = Range("Summary!A102")
    Temp = Left(Summary_Text, 200)
        
    ActiveSheet.Shapes("Text Box 3").Select
    Selection.Characters.Text = Temp
    count_text = 201
    Do
        Summary_Text = Mid(Summary_Text, 201)
        Temp = Left(Summary_Text, 200)
        
        Selection.Characters(count_text).Insert String:=Temp
        
        If Len(Summary_Text) < 200 Then Exit Do
        count_text = count_text + 200
    Loop

    Worksheets("Summary").Select
    Range("A1").Select
    Worksheets("Report Information").Select
    Range("A1").Select
End Sub

Open in new window

jlcannonAsked:
Who is Participating?
 
Ingeborg Hawighorst (Microsoft MVP / EE MVE)Connect With a Mentor Microsoft MVP ExcelCommented:
Hello,

looks like the sheet might be protected. Use code to unprotect it before selecting anything.

    ActiveSheet.Unprotect

cheers, teylyn

0
 
Ingeborg Hawighorst (Microsoft MVP / EE MVE)Microsoft MVP ExcelCommented:
If the sheet has a password, you can use this

' after the dim statements
    ActiveSheet.Unprotect Password:="secret"

' rest of your code


' before selecting the next sheet
    ActiveSheet.Protect  Contents:=True, Password:="secret"

Open in new window


cheers, teylyn

0
 
jlcannonAuthor Commented:
perfection A+
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.