+ Reply to Thread
Results 1 to 6 of 6

Need Help with Run-time error

Hybrid View

  1. #1
    Digital2k
    Guest

    Need Help with Run-time error

    Hello Group,

    I have a excel spreadsheet (2003) that has a wave file. I created a macro to
    play the file.
    I want to Protect the sheet. When I play the file when the sheet is lock I
    get a Run-time error.
    This is the macro:

    Play Macro

    ActiveSheet.Shapes("Object 100").Select
    Selection.Verb Verb:=xlPrimary
    Range("B8").Select
    End Sub

    When I select debug this is the line that is highlighted:
    ActiveSheet.Shapes("Object 100").Select

    Any help on this matter is appreciated.
    Digital2k



  2. #2
    Bob Phillips
    Guest

    Re: Need Help with Run-time error

    Just take protection off

    Play Macro

    Activesheet.Unprotect
    ActiveSheet.Shapes("Object 100").Select
    Selection.Verb Verb:=xlPrimary
    Range("B8").Select
    Activesheet.Protect
    End Sub


    --
    HTH

    Bob Phillips

    (replace somewhere in email address with gmail if mailing direct)

    "Digital2k" <digital2k@adelphia.net> wrote in message
    news:N8mdnSAEOK4WVjbZnZ2dnUVZ_oGdnZ2d@adelphia.com...
    > Hello Group,
    >
    > I have a excel spreadsheet (2003) that has a wave file. I created a macro

    to
    > play the file.
    > I want to Protect the sheet. When I play the file when the sheet is lock I
    > get a Run-time error.
    > This is the macro:
    >
    > Play Macro
    >
    > ActiveSheet.Shapes("Object 100").Select
    > Selection.Verb Verb:=xlPrimary
    > Range("B8").Select
    > End Sub
    >
    > When I select debug this is the line that is highlighted:
    > ActiveSheet.Shapes("Object 100").Select
    >
    > Any help on this matter is appreciated.
    > Digital2k
    >
    >




  3. #3
    Digital2k
    Guest

    Re: Need Help with Run-time error

    I thought excel can do almost anything. I'm sure there must be a way to have
    my spreadsheet locked and have the ability to play a file. I have a picture
    as the object linked to the macro to play the file and it is unprotected.
    This is the error: Method 'Select' of object 'Shape' failed.
    Can anyone help?
    Thanks,
    Digital2k

    "Bob Phillips" <bob.NGs@somewhere.com> wrote in message
    news:e619LEEoGHA.1332@TK2MSFTNGP05.phx.gbl...
    > Just take protection off
    >
    > Play Macro
    >
    > Activesheet.Unprotect
    > ActiveSheet.Shapes("Object 100").Select
    > Selection.Verb Verb:=xlPrimary
    > Range("B8").Select
    > Activesheet.Protect
    > End Sub
    >
    >
    > --
    > HTH
    >
    > Bob Phillips
    >
    > (replace somewhere in email address with gmail if mailing direct)
    >
    > "Digital2k" <digital2k@adelphia.net> wrote in message
    > news:N8mdnSAEOK4WVjbZnZ2dnUVZ_oGdnZ2d@adelphia.com...
    >> Hello Group,
    >>
    >> I have a excel spreadsheet (2003) that has a wave file. I created a macro

    > to
    >> play the file.
    >> I want to Protect the sheet. When I play the file when the sheet is lock
    >> I
    >> get a Run-time error.
    >> This is the macro:
    >>
    >> Play Macro
    >>
    >> ActiveSheet.Shapes("Object 100").Select
    >> Selection.Verb Verb:=xlPrimary
    >> Range("B8").Select
    >> End Sub
    >>
    >> When I select debug this is the line that is highlighted:
    >> ActiveSheet.Shapes("Object 100").Select
    >>
    >> Any help on this matter is appreciated.
    >> Digital2k
    >>
    >>

    >
    >




  4. #4
    Bob Phillips
    Guest

    Re: Need Help with Run-time error

    My suggestion was to temporarily remove it and then put it back, via code.

    --
    HTH

    Bob Phillips

    (replace somewhere in email address with gmail if mailing direct)

    "Digital2k" <digital2k@adelphia.net> wrote in message
    news:geudnUZ2B5ErTjbZnZ2dnUVZ_vGdnZ2d@adelphia.com...
    > I thought excel can do almost anything. I'm sure there must be a way to

    have
    > my spreadsheet locked and have the ability to play a file. I have a

    picture
    > as the object linked to the macro to play the file and it is unprotected.
    > This is the error: Method 'Select' of object 'Shape' failed.
    > Can anyone help?
    > Thanks,
    > Digital2k
    >
    > "Bob Phillips" <bob.NGs@somewhere.com> wrote in message
    > news:e619LEEoGHA.1332@TK2MSFTNGP05.phx.gbl...
    > > Just take protection off
    > >
    > > Play Macro
    > >
    > > Activesheet.Unprotect
    > > ActiveSheet.Shapes("Object 100").Select
    > > Selection.Verb Verb:=xlPrimary
    > > Range("B8").Select
    > > Activesheet.Protect
    > > End Sub
    > >
    > >
    > > --
    > > HTH
    > >
    > > Bob Phillips
    > >
    > > (replace somewhere in email address with gmail if mailing direct)
    > >
    > > "Digital2k" <digital2k@adelphia.net> wrote in message
    > > news:N8mdnSAEOK4WVjbZnZ2dnUVZ_oGdnZ2d@adelphia.com...
    > >> Hello Group,
    > >>
    > >> I have a excel spreadsheet (2003) that has a wave file. I created a

    macro
    > > to
    > >> play the file.
    > >> I want to Protect the sheet. When I play the file when the sheet is

    lock
    > >> I
    > >> get a Run-time error.
    > >> This is the macro:
    > >>
    > >> Play Macro
    > >>
    > >> ActiveSheet.Shapes("Object 100").Select
    > >> Selection.Verb Verb:=xlPrimary
    > >> Range("B8").Select
    > >> End Sub
    > >>
    > >> When I select debug this is the line that is highlighted:
    > >> ActiveSheet.Shapes("Object 100").Select
    > >>
    > >> Any help on this matter is appreciated.
    > >> Digital2k
    > >>
    > >>

    > >
    > >

    >
    >




  5. #5
    Digital2k
    Guest

    Re: Need Help with Run-time error

    Thank you Bob!
    That worked

    "Bob Phillips" <bob.NGs@somewhere.com> wrote in message
    news:%23MHTEQEoGHA.3532@TK2MSFTNGP04.phx.gbl...
    > My suggestion was to temporarily remove it and then put it back, via code.
    >
    > --
    > HTH
    >
    > Bob Phillips
    >
    > (replace somewhere in email address with gmail if mailing direct)
    >
    > "Digital2k" <digital2k@adelphia.net> wrote in message
    > news:geudnUZ2B5ErTjbZnZ2dnUVZ_vGdnZ2d@adelphia.com...
    >> I thought excel can do almost anything. I'm sure there must be a way to

    > have
    >> my spreadsheet locked and have the ability to play a file. I have a

    > picture
    >> as the object linked to the macro to play the file and it is unprotected.
    >> This is the error: Method 'Select' of object 'Shape' failed.
    >> Can anyone help?
    >> Thanks,
    >> Digital2k
    >>
    >> "Bob Phillips" <bob.NGs@somewhere.com> wrote in message
    >> news:e619LEEoGHA.1332@TK2MSFTNGP05.phx.gbl...
    >> > Just take protection off
    >> >
    >> > Play Macro
    >> >
    >> > Activesheet.Unprotect
    >> > ActiveSheet.Shapes("Object 100").Select
    >> > Selection.Verb Verb:=xlPrimary
    >> > Range("B8").Select
    >> > Activesheet.Protect
    >> > End Sub
    >> >
    >> >
    >> > --
    >> > HTH
    >> >
    >> > Bob Phillips
    >> >
    >> > (replace somewhere in email address with gmail if mailing direct)
    >> >
    >> > "Digital2k" <digital2k@adelphia.net> wrote in message
    >> > news:N8mdnSAEOK4WVjbZnZ2dnUVZ_oGdnZ2d@adelphia.com...
    >> >> Hello Group,
    >> >>
    >> >> I have a excel spreadsheet (2003) that has a wave file. I created a

    > macro
    >> > to
    >> >> play the file.
    >> >> I want to Protect the sheet. When I play the file when the sheet is

    > lock
    >> >> I
    >> >> get a Run-time error.
    >> >> This is the macro:
    >> >>
    >> >> Play Macro
    >> >>
    >> >> ActiveSheet.Shapes("Object 100").Select
    >> >> Selection.Verb Verb:=xlPrimary
    >> >> Range("B8").Select
    >> >> End Sub
    >> >>
    >> >> When I select debug this is the line that is highlighted:
    >> >> ActiveSheet.Shapes("Object 100").Select
    >> >>
    >> >> Any help on this matter is appreciated.
    >> >> Digital2k
    >> >>
    >> >>
    >> >
    >> >

    >>
    >>

    >
    >




  6. #6
    markwalling
    Guest

    Re: Need Help with Run-time error

    you cannot select locked objects. you either have to unprotect the
    sheet during th macro, or unprotect the object
    Digital2k wrote:
    > Hello Group,
    >
    > I have a excel spreadsheet (2003) that has a wave file. I created a macro to
    > play the file.
    > I want to Protect the sheet. When I play the file when the sheet is lock I
    > get a Run-time error.
    > This is the macro:
    >
    > Play Macro
    >
    > ActiveSheet.Shapes("Object 100").Select
    > Selection.Verb Verb:=xlPrimary
    > Range("B8").Select
    > End Sub
    >
    > When I select debug this is the line that is highlighted:
    > ActiveSheet.Shapes("Object 100").Select
    >
    > Any help on this matter is appreciated.
    > Digital2k



+ Reply to Thread

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