Hi All,
I need help to combine two different vba codes in order to achieve a desired result.
I want to be able to have a full Excel 2007 screen all through the workbook. The 3 buttons (maximize, restore and close) should also be disabled. I have two different codes to achieve those but because of my baby knowledge in vba, I don't know how to combine the two, and I therefore need help please.
In order to achieve a full screen, I found a code which was kindly provided by a guru member of the forum (RoyUk). I have shown below the two-part code for the full screen, indicating where each part is placed into:
In 'ThisWorkbook'
In "Module 1"![]()
Please Login or Register to view this content.
Although the above code achieves full screen, the only thing that still shows is the bar which houses the 3 buttons (minimize, restore and close)![]()
Please Login or Register to view this content.
I do not need the 'X' close button. There is a command button (EXIT button) on the first (Menu) sheet which users must use to exit the program. I therefore need to disable the remaining three buttons - the 'X-close button and the minimize and restore close buttons also.
In my search, I also found, and have appended below,a vba code that disables those 3 buttons, as follows:
My problem is how to combine the two sets of codes.![]()
Please Login or Register to view this content.
When I try including this last set of codes in 'ThisWorkbook' along with the fullscreen code above, I get a 'Compile Error - Ambiguous name detected: Workbook before close' message, and I therefore believe I must be doing something wrong. I have also tried placing this last set of codes in a separate Module. I believe it is also wrong cos it doesn't disable the 3 remaining buttons.
For the code that disables the 3 buttons to work, I think that it should go also onto 'ThisWorkbook', but I need help on how to combine it with the 'fullscreen' code above.
Please can someone help me. And if RoyUk will be reading this, I would appreciate his help on how to incorporate the 3-buttons-disable-code to his fullscreen code, please.
Thanks all in anticipation of your kind help.
Newqueen
Bookmarks