Results 1 to 4 of 4

Thread: Macro To Enable Disable Or Lock Unlock A Checkbox After An Action Is Performed

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Junior Member
    Join Date
    Aug 2013
    Posts
    9
    Rep Power
    0

    Macro To Enable Disable Or Lock Unlock A Checkbox After An Action Is Performed

    ***Edited from original post***

    Hello all,

    I am back with a simple question - I have searched and can't seem to find a direct answer.

    I have a check-box which I don't want to be enabled/clickable unless an object is selected by the user. (The object is a pdf file). To provide some context, I want to 'force' the user to read the .pdf before they can click the check box.

    How can I set up a rule/macro that see the check box disabled unless a given object is selected?

    Kind regards,

    A.

    https://www.youtube.com/channel/UCnxwq2aGJRbjOo_MO54oaHA

    https://www.youtube.com/channel/UCnxwq2aGJRbjOo_MO54oaHA
    https://www.youtube.com/watch?v=XQAIYCT4f8Q&lc=UgwTUdEgR4bdt6crKXF4AaABAg. 9xmkXGSciKJ9xonTti2sIx
    https://www.youtube.com/watch?v=XQAIYCT4f8Q&lc=UgwWw16qBFX39JCRRm54AaABAg. 9xnskBhPnmb9xoq3mGxu_b
    https://www.youtube.com/watch?v=XQAIYCT4f8Q&lc=UgzgWvzV-kvC4TJ8O414AaABAg.9xnFzCj8HRM9xon1p2ImxO
    https://www.youtube.com/watch?v=XQAIYCT4f8Q&lc=UgybZfNJd3l4FokX3cV4AaABAg. 9xm_ufqOILb9xooIlv5PLY
    https://www.youtube.com/watch?v=XQAIYCT4f8Q&lc=UgzgWvzV-kvC4TJ8O414AaABAg.9xnFzCj8HRM9y38bzbSqaG
    https://www.youtube.com/watch?v=XQAIYCT4f8Q&lc=UgyWm8nL7syjhiHtpBF4AaABAg. 9xmt8i0IsEr9y3FT9Y9FeM
    https://www.youtube.com/watch?v=jTmVtPHtiTg&lc=Ugy_RiNN_kAqUvZ8W994AaABAg. 9xhyRrsUUOM9xpn-GDkL3o
    https://www.youtube.com/watch?v=jTmVtPHtiTg&lc=Ugy_RiNN_kAqUvZ8W994AaABAg
    https://www.youtube.com/watch?v=QjEWAJ3d-jw&lc=UgxJLVpwY8fIla7G-pN4AaABAg.9BLeCWVhxdG9wgNsaS3Lp1
    https://www.youtube.com/watch?v=QjEWAJ3d-jw&lc=UgxJLVpwY8fIla7G-pN4AaABAg.9BLeCWVhxdG9wgR1EPUkhw
    https://www.youtube.com/watch?v=QjEWAJ3d-jw&lc=UgxJLVpwY8fIla7G-pN4AaABAg.9BLeCWVhxdG9wgNe_XC-jK
    https://www.youtube.com/watch?v=QjEWAJ3d-jw&lc=UgxJLVpwY8fIla7G-pN4AaABAg.9BLeCWVhxdG9wgNPOdiDuv
    https://www.youtube.com/watch?v=QjEWAJ3d-jw&lc=UgxJLVpwY8fIla7G-pN4AaABAg.9BLeCWVhxdG9wgN7AC7wAc
    https://www.youtube.com/channel/UCnxwq2aGJRbjOo_MO54oaHA
    Last edited by DocAElstein; 12-14-2023 at 03:00 AM.

  2. #2
    Junior Member
    Join Date
    Aug 2013
    Posts
    9
    Rep Power
    0
    As a means of an update, I have managed to setup a macro which opens the embedded document and then unlocks the checkbox by removing sheet protection, editing the checkbox's protection properties and then re-protecting the sheet.

    Code:
    Sub OpenPDF()
        
        ActiveSheet.OLEObjects("Object 6").Verb xlVerbOpen
        
        Worksheets("Change Proposal").Unprotect Password:="FUDGE"
        ActiveSheet.Shapes("CheckBox1").Select
        Selection.Locked = False
        ActiveSheet.Protect Password:="FUDGE"
    
    End Sub
    The problem I have is that the checkbox (I have tried standard and active X) will not disable, even when the sheet and the checkbox is protected.

    Is there another way?

  3. #3
    Junior Member
    Join Date
    Aug 2013
    Posts
    9
    Rep Power
    0
    Chaps,

    A further update: I can't seem to find any information anywhere to reliably disable an activex checkbox until an object is selected (using format control).

    Instead, I've anchored the checkbox to a row and hidden it. Then used a macro that un-hides the the row (and checkbox) and simultaneously launches the object/program in question.

    If anybody has a less clunky way of doing this, I should love to hear from you!

    A.

  4. #4
    Junior Member
    Join Date
    Aug 2013
    Posts
    18
    Rep Power
    0
    please try this code to disable checkbox
    Code:
    ActiveSheet.CheckBox1.Enabled = False

Similar Threads

  1. Replies: 2
    Last Post: 08-22-2013, 12:23 AM
  2. Import Export Spreadsheet Macro Action Specific Sheet
    By Portucale in forum Access Help
    Replies: 3
    Last Post: 08-06-2013, 07:42 AM
  3. CheckBox to see password
    By Ingolf in forum Excel Help
    Replies: 9
    Last Post: 08-26-2012, 11:56 PM
  4. How to Lock or Unlock row basis previous cell input?
    By Rajesh Kr Joshi in forum Excel Help
    Replies: 2
    Last Post: 07-25-2012, 02:40 PM
  5. Scroll Lock and Unlock using VBA
    By LalitPandey87 in forum Excel Help
    Replies: 2
    Last Post: 11-08-2011, 08:59 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •