Run-time error opening an excel workbook

Posted on 2011-10-25
Last Modified: 2012-05-12
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
    Summary_Text = Range("Summary!A102")
    Temp = Left(Summary_Text, 200)
    ActiveSheet.Shapes("Text Box 3").Select
    Selection.Characters.Text = Temp
    count_text = 201
        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

    Worksheets("Report Information").Select
End Sub

Open in new window

Question by:jlcannon
    LVL 50

    Accepted Solution


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


    cheers, teylyn

    LVL 50

    Expert Comment

    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


    Author Closing Comment

    perfection A+

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    6 Surprising Benefits of Threat Intelligence

    All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

    A little background as to how I came to I design this code: Around 5 years ago I designed an add-in that formatted Excel files to a corporate standard, applying different cell colours and font type depending on whether the cells contained inputs,…
    Recently Microsoft released a brand new function called CONCAT. It's supposed to replace its predecessor CONCATENATE. But how does it work? And what's new? In this article, we take a closer look at all of this - we even included an exercise file for…
    Learn how to create and modify your own paragraph styles in Microsoft Word. This can be helpful when wanting to make consistently referenced styles throughout a document or template.
    This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now