+ Reply to Thread
Results 1 to 8 of 8

How to ACTUALLY click a button in excel? (triggering the "disable edit" bug)

  1. #1
    Forum Contributor
    Join Date
    10-10-2018
    Location
    Calgary, Canada
    MS-Off Ver
    Excel 2019 Windows 11
    Posts
    219

    How to ACTUALLY click a button in excel? (triggering the "disable edit" bug)

    Okay, I've googled this, and I haven't found an answer.

    Excel has this funny bug where if you disable the formula bar and click a button, the edit functionality disappears until you exit out of the worksheet and go back in. The way I got around this was to enable the formula bar and then disable it again, which causes the cursor to re-appear.

    However - I want to use this "disable editing" bug to my advantage. I have a worksheet called "Config" that contains all the various values that I use in other worksheets, and I don't want users to edit this worksheet.

    So I created a dummy button, and sure enough, by clicking this dummy button (with formula bar disabled), it does make the cursor disappear and thus prevents editing. The problem is that I don't know how to activate this dummy button whenever the worksheet is activated. I know the various ways to activate the clickbutton event, but activating the event does not trigger the "disable editing" bug.

    Any ideas? Thanks!

  2. #2
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,432

    Re: How to ACTUALLY click a button in excel? (triggering the "disable edit" bug)

    .
    Quicker and easier to password protect that one sheet.

  3. #3
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    26,921

    Re: How to ACTUALLY click a button in excel? (triggering the "disable edit" bug)

    First, I have not heard of the bug you're describing, and I can't reproduce it. When you say "disable" the formula bar I assume you mean to uncheck it under View; I don't know what else that could mean. I tried this with an ActiveX button and a Forms button and after clicking each, I could still edit the sheet.

    Depending on bug behavior is not usually a good idea. Instead I would add a macro so your button protects the worksheet. That is the textbook method to prevent editing.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  4. #4
    Forum Contributor
    Join Date
    10-10-2018
    Location
    Calgary, Canada
    MS-Off Ver
    Excel 2019 Windows 11
    Posts
    219

    Re: How to ACTUALLY click a button in excel? (triggering the "disable edit" bug)

    use this code to disable formula bar:

    Application.DisplayFormulaBar = false

    Then try clicking a button - the cursor will then disappear from that worksheet.

  5. #5
    Forum Contributor
    Join Date
    10-10-2018
    Location
    Calgary, Canada
    MS-Off Ver
    Excel 2019 Windows 11
    Posts
    219

    Re: How to ACTUALLY click a button in excel? (triggering the "disable edit" bug)

    Quote Originally Posted by Logit View Post
    .
    Quicker and easier to password protect that one sheet.
    protecting that one sheet prevents macros from editing that sheet. Like I said, that worksheet contains values used by other worksheets. Macros in other worksheets contain all their values, such as dropdowns that are dynamically updated in the "Config" worksheet. So protecting the worksheet won't work.

  6. #6
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,996

    Re: How to ACTUALLY click a button in excel? (triggering the "disable edit" bug)

    Protect it when opening the workbook and specify the userinterfaceonly:=true argument.
    Everyone who confuses correlation and causation ends up dead.

  7. #7
    Forum Contributor
    Join Date
    10-10-2018
    Location
    Calgary, Canada
    MS-Off Ver
    Excel 2019 Windows 11
    Posts
    219

    Re: How to ACTUALLY click a button in excel? (triggering the "disable edit" bug)

    Quote Originally Posted by rorya View Post
    Protect it when opening the workbook and specify the userinterfaceonly:=true argument.
    Thank-you for replying. Actually as soon as I said "it won't work" I went and Googled how to protect a worksheet from users only, and it came up with the userinterfaceonly argument. Thanks for helping.

    My spreadsheet is a showcase of functionality that is basically Jira with forecasting and resource planning ability. If there is anything cool that you can do with Excel macros, I'll find a way to incorporate it into my spreadsheet. So if there's a way to ACTUALLY click a button as requested in the OP (disregarding the fact that there is an alternative way to achieve the objective), please let me know. Thanks!

  8. #8
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,432

    Re: How to ACTUALLY click a button in excel? (triggering the "disable edit" bug)

    .
    Paste in the Sheet Module :

    Please Login or Register  to view this content.

    Paste in ThisWorkbook Module :

    Please Login or Register  to view this content.

    As indicated above, Excel opens Sheet1 by default unless otherwise instructed in the Workbook_Open event. If the command button you are targeting resides on Sheet1, these macros will do what you desire.
    If the command button resides on any other sheet, the only macro required is the first two - you can ignore the ThisWorkbook_Module macros. NOTE: this macro relies on an ActiveX CommandButton ... not a
    UserForm Button.

    Hope this is understandable and that it helps.
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Disable excel's "Close" button (red X) in workbook for more than 1 click
    By Skhotheni in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 07-29-2018, 07:23 PM
  2. [SOLVED] Disable "Right Click" ... or any ability to "cut", "insert", etc.
    By jonvanwyk in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-23-2011, 09:26 AM
  3. How to change a Command Button caption from "Enable" to "Disable"?
    By Infinity in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-22-2007, 12:14 AM
  4. Making a macro-triggering custom menu button "travel" with a file
    By lingyai in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-13-2007, 04:51 PM
  5. excel status bar says "double-click to edit PBrush"
    By leo in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-07-2006, 11:10 AM
  6. [SOLVED] How do I get "file" tab to click on, it starts with "edit"
    By JMD_Phoenix in forum Excel General
    Replies: 1
    Last Post: 01-22-2006, 10:50 PM
  7. [SOLVED] Replace "insert function" with "edit formula" button in fourmula b
    By 13brian in forum Excel General
    Replies: 0
    Last Post: 08-24-2005, 04:05 PM

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