+ Reply to Thread
Results 1 to 7 of 7

Vba to hide close button on excel application

  1. #1
    Forum Guru Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2019 | 2021
    Posts
    15,027

    Vba to hide close button on excel application

    Hi All

    I found this workbook on line which contains code to hide the close button. It works great, but am not able to see the code that actually does the trick. I want to be able to hide the button on workbook open event. Can anyone perhaps have a look and see how i can adapt to suite my needs.
    Attached Files Attached Files

  2. #2
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,788

    Re: Vba to hide close button on excel application

    But it is not working for me as you described.

    Tested it on Windows-XP (xl 2010 version)


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

  3. #3
    Forum Guru Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2019 | 2021
    Posts
    15,027

    Re: Vba to hide close button on excel application

    Hey there Sixthsense

    I'm using Windows-7 Excel 2007

  4. #4
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: Vba to hide close button on excel application

    Quote Originally Posted by sintek View Post
    It works great, but am not able to see the code that actually does the trick.
    The code is in module 2 and the ShowCaption routine is called by the code in Sheet1.
    Don
    Please remember to mark your thread 'Solved' when appropriate.

  5. #5
    Forum Guru Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2019 | 2021
    Posts
    15,027

    Re: Vba to hide close button on excel application

    Hi xlnitwit

    Thanks for reply... What part of the code runs when I press [False]. The part actually hides the x.
    How can i get the code to hide the x when the workbook opens.

  6. #6
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: Vba to hide close button on excel application

    Look at the code in Sheet1- there is one routine for each button. They both call the same routine but one passes True as the argument, the other False.

  7. #7
    Forum Guru Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2019 | 2021
    Posts
    15,027

    Re: Vba to hide close button on excel application

    I'm a dumb dumb...Now I get it.

    Thanks xlnitwit for clearing that up for me.

+ 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] VBA to hide close button
    By Sintek in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 09-21-2016, 07:10 AM
  2. [SOLVED] The application close button doesn't work after speicifc activity
    By YasserKhalil in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-25-2015, 07:37 AM
  3. vba code to disable only close button and close through a button in Excel workbook
    By atif_ar in forum Excel Programming / VBA / Macros
    Replies: 47
    Last Post: 11-23-2014, 02:41 PM
  4. VBA Code to Disable Excel Close button also disabling my Close Button
    By akynyemi in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-28-2013, 12:56 PM
  5. Hide or disable the 'Close' button
    By 5631 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-18-2008, 12:36 PM
  6. Hide red close button
    By masanovic1 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-01-2008, 07:07 AM
  7. Disable the "X" close button in an excel application
    By Tempy in forum Excel Programming / VBA / Macros
    Replies: 22
    Last Post: 04-19-2005, 11:06 AM

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