+ Reply to Thread
Results 1 to 7 of 7

Why does this custom function work when in Break mode?

  1. #1
    Forum Contributor
    Join Date
    08-12-2019
    Location
    NYC
    MS-Off Ver
    2019
    Posts
    155

    Why does this custom function work when in Break mode?

    Hi all,

    I have a very simple function whose purpose is simply to mirror a cell (A) in a different cell (B) using VBA. The whole point of this "bridge" is to force users to activate VBA / macros in order to get the proper value in cell (B), which then drives the excel template. I was thinking: if macros are not activated, custom functions won't run and cell (B) won't show the value of cell (A).

    But apparently, even in break mode, the following custom function works:
    Please Login or Register  to view this content.
    1. Do you know why this piece of code works even when macros are not activated / when in break mode?
    2. Is there a way to adjust the code to make it inactive when macros are off / break mode? (using functions preferably as I'm using that bridge for quite a few values throughout the spreadsheet)

    Thanks!

  2. #2
    Forum Expert
    Join Date
    04-01-2013
    Location
    East Auckland
    MS-Off Ver
    Excel 365
    Posts
    1,343

    Re: Why does this custom function work when in Break mode?

    It doesn't run in break mode for me.
    If you want something done right... find a forum and ask an online expert.

    Time flies like an arrow. Fruit flies like a banana.

  3. #3
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,464

    Re: Why does this custom function work when in Break mode?

    Break mode isn't the same as macros enabled/disabled.

    Quite often, once you have enabled macros in a workbook, it will become trusted. It may no longer ask, but I suspect that macros are enabled.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  4. #4
    Forum Contributor
    Join Date
    08-12-2019
    Location
    NYC
    MS-Off Ver
    2019
    Posts
    155

    Re: Why does this custom function work when in Break mode?

    Quote Originally Posted by TMS View Post
    Break mode isn't the same as macros enabled/disabled.

    Quite often, once you have enabled macros in a workbook, it will become trusted. It may no longer ask, but I suspect that macros are enabled.
    Interesting! I think you're right. The file I've been working on has macros activated (when not, the code does't run at all). I didn't know there was a distinction between macros not activated and break mode ON. So is there a way to make that code NOT work when also in break mode? Basically, I want to prevent users from being able to use the spreadsheet (by blocking the mirroring of the value) if break mode is ON. Maybe by adding a few "bridge" lines that definitely require Break Mode to be OFF to be able to run properly?
    Last edited by MagnusNovak; 10-27-2023 at 01:32 PM.

  5. #5
    Forum Contributor
    Join Date
    08-12-2019
    Location
    NYC
    MS-Off Ver
    2019
    Posts
    155

    Re: Why does this custom function work when in Break mode?

    Quote Originally Posted by scottiex View Post
    It doesn't run in break mode for me.
    It's weird, when I create a brand new excel file and just add this code, the function doesn't work for me either in break mode. But it does work in the main spreadsheet I've been working on until now..

  6. #6
    Forum Contributor
    Join Date
    08-12-2019
    Location
    NYC
    MS-Off Ver
    2019
    Posts
    155

    Re: Why does this custom function work when in Break mode?

    Hi everyone,

    Just following up to check if anyone has any idea on how to make sure that this "bridge" VBA function won't work when break mode is ON?

  7. #7
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,829

    Re: Why does this custom function work when in Break mode?

    I think we need more information about the problem you are experiencing. Can you put the function in a spreadsheet (along with anything else necessary to recreate the problem), then provide instructions for recreating the issue you are seeing? It seems to me that if we are going to help with a solution, we've got to be able to create the problem on our own systems.
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

+ 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. [SOLVED] INDEX, MODE & MATCH Array Function will not work on Multiple Columns
    By Lycanthrope74 in forum Excel Formulas & Functions
    Replies: 14
    Last Post: 06-06-2020, 01:44 AM
  2. VBA AutoFilter does not Work in run mode, only in debug mode
    By aganove in forum Excel Programming / VBA / Macros
    Replies: 19
    Last Post: 11-19-2015, 04:32 PM
  3. [SOLVED] Countif, mode function formulas doesnt work the way I wish it should be
    By moniquem in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 03-27-2013, 02:54 AM
  4. [SOLVED] mode function does not work
    By moniquem in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 03-18-2013, 11:45 AM
  5. Break Mode
    By bstubbs in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-22-2011, 03:22 AM
  6. Can I use VBA to check if the sheet(xxx) is in Page-Break mode or Normal mode ?
    By BaLLZaCH in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-15-2008, 09:03 AM
  7. [SOLVED] Help with Break Mode
    By Lost and Looking for Help in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-01-2006, 03:25 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