+ Reply to Thread
Results 1 to 4 of 4

On new window trigger

  1. #1
    Registered User
    Join Date
    05-16-2018
    Location
    Newcastle Maitland
    MS-Off Ver
    365
    Posts
    8

    On new window trigger

    Hi Everyone,

    Hoping someone might be able to point me in the right direction, what I am trying to do is have a macro run when someone clicks the "New Window" button within the view tab.

    I have a separate bit of code that creates the new window and runs the code, however I really want to ensure the user doesn't press the button and bypass the code I am hoping to run.

    Many thanks,

    Matt

  2. #2
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,903

    Re: On new window trigger

    You can do that by intercepting or disabling the New Window button in the CustomUI part of your workbook. So you'd use something like:

    PHP Code: 
    command idMso="WindowNew" enabled=False</command
    Rory

  3. #3
    Forum Expert
    Join Date
    02-14-2009
    Location
    .
    MS-Off Ver
    ................
    Posts
    2,840

    Re: On new window trigger

    ... intercept, and repurpose it to run your existing procedure to open a new window.

    Either way, you'll be editing the ribbon XML which is a whole new world of pain. Example below displays a message box when the New Window button is clicked..
    Attached Files Attached Files
    Last edited by cytop; 06-13-2022 at 04:51 AM.

  4. #4
    Registered User
    Join Date
    05-16-2018
    Location
    Newcastle Maitland
    MS-Off Ver
    365
    Posts
    8

    Re: On new window trigger

    Legends!!! Thanks heaps, that worked a charm

+ 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. Switch from Active Window to Variable Window/Rename Varaible Sheet
    By CravingGod in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-04-2016, 09:52 AM
  2. [SOLVED] Copy Tables from IE window to Excel - Need help making code see already opened window
    By mattyp in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-27-2015, 08:14 AM
  3. Window resize doesn't trigger a line of code
    By YasserKhalil in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-24-2015, 12:11 PM
  4. Adjust a code from cell range trigger to button trigger
    By ld2x07 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-01-2014, 10:02 AM
  5. Replies: 2
    Last Post: 09-11-2013, 04:35 AM
  6. Replies: 4
    Last Post: 02-17-2011, 08:29 AM
  7. [SOLVED] unable to get the excel app event trigger for for window resize
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-29-2005, 11:10 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