![]() |
removing maximize control from excel application (not justworksheet)?
hi all,
I am trying to remove the maximize control (the small square control common to most windows) from the top right of Excel (the application, not just the worksheet) and I can remove everything BUT the maximize and minimize controls with code similar to: lHandle = FindWindowA(vbNullString, Application.Caption) If lHandle < 0 Then DeleteMenu GetSystemMenu(lHandle, False), 0, MF_BYPOSITION DeleteMenu GetSystemMenu(lHandle, False), 1, MF_BYPOSITION .....etc A variation of the code above removes the maximize option from the system menu but does NOT remove the maximize icon (the small square) too. Strangely I can disable the "X" that closes the application without any problems.... Is it possible to do it? I want to stop the user maximizing Excel as I am trying to make the worksheet look like more of a standalone application. Its working pretty well apart from this issue! thanks guys! Gav |
removing maximize control from excel application (not just workshe
Perhaps this instead:
Sub Test() With Application .DisplayFullScreen = Not .DisplayFullScreen 'True .CommandBars(1).Enabled = Not .CommandBars(1).Enabled 'False .CommandBars("Full Screen").Visible = False End With End Sub Greg "151" wrote: hi all, I am trying to remove the maximize control (the small square control common to most windows) from the top right of Excel (the application, not just the worksheet) and I can remove everything BUT the maximize and minimize controls with code similar to: lHandle = FindWindowA(vbNullString, Application.Caption) If lHandle < 0 Then DeleteMenu GetSystemMenu(lHandle, False), 0, MF_BYPOSITION DeleteMenu GetSystemMenu(lHandle, False), 1, MF_BYPOSITION .....etc A variation of the code above removes the maximize option from the system menu but does NOT remove the maximize icon (the small square) too. Strangely I can disable the "X" that closes the application without any problems.... Is it possible to do it? I want to stop the user maximizing Excel as I am trying to make the worksheet look like more of a standalone application. Its working pretty well apart from this issue! thanks guys! Gav |
removing maximize control from excel application (not justworkshe
hi,
hmm yeah the problem is I dont want it to run full screen really as there ends up being a lot of "white space" shown. I am retrofitting an existing spreadsheet to look like an application so am kind of restricted in what I can do. I suspect that I might have to just ensure it looks "okish" if the user decides to click the maximize button by rearranging it visually. Its just strange that I can disable every control except the max/min ones! It would make more sense to me if it was impossible to disable the "X" close button! On Nov 30, 3:18 am, Greg Wilson wrote: Perhaps this instead: Sub Test() With Application .DisplayFullScreen = Not .DisplayFullScreen 'True .CommandBars(1).Enabled = Not .CommandBars(1).Enabled 'False .CommandBars("Full Screen").Visible = False End With End Sub Greg "151" wrote: hi all, I am trying to remove the maximize control (the small square control common to most windows) from the top right ofExcel(the application, not just the worksheet) and I can remove everything BUT the maximize and minimize controls with code similar to: lHandle = FindWindowA(vbNullString, Application.Caption) If lHandle < 0 Then DeleteMenu GetSystemMenu(lHandle, False), 0, MF_BYPOSITION DeleteMenu GetSystemMenu(lHandle, False), 1, MF_BYPOSITION .....etc A variation of the code above removes the maximize option from the system menu but does NOT remove the maximize icon (the small square) too. Strangely I can disable the "X" that closes the application without any problems.... Is it possible to do it? I want to stop the user maximizingExcelas I am trying to make the worksheet look like more of a standalone application. Its working pretty well apart from this issue! thanks guys! Gav |
All times are GMT +1. The time now is 09:11 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com