+ Reply to Thread
Results 1 to 3 of 3

Disabling shapes and controls

  1. #1
    Jonathan Orgel
    Guest

    Disabling shapes and controls

    How do I disable/lock all controls and shapes on a worksheet. Or if you how
    do I disable a specific checkbor or textbox.

    I tried the code below but this just 'disables' the buttons. Checkboxes and
    textboxes can still be changed.

    For Each S In Sheet.Shapes
    S.OnAction = ""
    S.Locked = True
    Next
    For Each V In Sheet.OLEObjects
    V.Enabled = False
    Next


    Thanks,

    Jonathan Orgel



  2. #2
    Ron de Bruin
    Guest

    Re: Disabling shapes and controls

    Hi Jonathan

    Try this

    On Error Resume Next
    ActiveSheet.DrawingObjects.Visible = True
    ActiveSheet.DrawingObjects.Enabled = True
    On Error GoTo 0

    See also
    http://www.rondebruin.nl/controlsobjectsworksheet.htm


    --
    Regards Ron de Bruin
    http://www.rondebruin.nl


    "Jonathan Orgel" <[email protected]> wrote in message news:%[email protected]...
    > How do I disable/lock all controls and shapes on a worksheet. Or if you how do I disable a specific checkbor or textbox.
    >
    > I tried the code below but this just 'disables' the buttons. Checkboxes and textboxes can still be changed.
    >
    > For Each S In Sheet.Shapes
    > S.OnAction = ""
    > S.Locked = True
    > Next
    > For Each V In Sheet.OLEObjects
    > V.Enabled = False
    > Next
    >
    >
    > Thanks,
    >
    > Jonathan Orgel
    >




  3. #3
    Ron de Bruin
    Guest

    Re: Disabling shapes and controls

    Oops

    Must be
    ActiveSheet.DrawingObjects.Enabled = False

    --
    Regards Ron de Bruin
    http://www.rondebruin.nl


    "Ron de Bruin" <[email protected]> wrote in message news:eTMBX%[email protected]...
    > Hi Jonathan
    >
    > Try this
    >
    > On Error Resume Next
    > ActiveSheet.DrawingObjects.Visible = True
    > ActiveSheet.DrawingObjects.Enabled = True
    > On Error GoTo 0
    >
    > See also
    > http://www.rondebruin.nl/controlsobjectsworksheet.htm
    >
    >
    > --
    > Regards Ron de Bruin
    > http://www.rondebruin.nl
    >
    >
    > "Jonathan Orgel" <[email protected]> wrote in message news:%[email protected]...
    >> How do I disable/lock all controls and shapes on a worksheet. Or if you how do I disable a specific checkbor or textbox.
    >>
    >> I tried the code below but this just 'disables' the buttons. Checkboxes and textboxes can still be changed.
    >>
    >> For Each S In Sheet.Shapes
    >> S.OnAction = ""
    >> S.Locked = True
    >> Next
    >> For Each V In Sheet.OLEObjects
    >> V.Enabled = False
    >> Next
    >>
    >>
    >> Thanks,
    >>
    >> Jonathan Orgel
    >>

    >
    >




+ 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