PC Review


Reply
Thread Tools Rating: Thread Rating: 1 votes, 1.00 average.

Disable or hide Cancel button on Save dialog box

 
 
Sandy
Guest
Posts: n/a
 
      20th Jun 2008
How do I hide or disable the cancel button on the normal "Do you want to
save the changes etc......" dialog box.
I presume code would be inserted into the "Workbook_BeforeClose(Cancel As
Boolean)" module.

TIA
Sandy

 
Reply With Quote
 
 
 
 
Sam Wilson
Guest
Posts: n/a
 
      20th Jun 2008

application.displayalerts = false

"Sandy" wrote:

> How do I hide or disable the cancel button on the normal "Do you want to
> save the changes etc......" dialog box.
> I presume code would be inserted into the "Workbook_BeforeClose(Cancel As
> Boolean)" module.
>
> TIA
> Sandy
>

 
Reply With Quote
 
Sandy
Guest
Posts: n/a
 
      20th Jun 2008
Can't get that to work Sam - Dialog box still contains Cancel:- full code as
follows:

Private Sub Workbook_BeforeClose(Cancel As Boolean)

ActiveWorkbook.Unprotect

Application.ScreenUpdating = False
Application.EnableEvents = False

Sheets("Current Round").Unprotect Password:=""
Sheets("Current Round Detailed").Unprotect Password:=""
Sheets("Current Round Graph").Unprotect Password:=""
Sheets("Home Graphs").Unprotect Password:=""
Sheets("Home Detailed Graphs").Unprotect Password:=""
Sheets("All Rounds").Unprotect Password:=""
Sheets("View Rounds").Unprotect Password:=""
Sheets("Search Rounds").Unprotect Password:=""
'Sheets("LogGraph3").Unprotect Password:=""

Dim wksht As Worksheet

With Application
.DisplayFormulaBar = True
.CommandBars("Worksheet Menu Bar").Enabled = True
.CommandBars("Standard").Visible = True
.CommandBars("Formatting").Visible = True
.CommandBars("Drawing").Visible = True
End With

For Each wksht In Worksheets(Array("Current Round", "Current Round
Detailed", _
"Current Round Graph", "Home Detailed Graphs", "Home Graphs", "All
Rounds", "View Rounds", "Search Rounds"))
wksht.Activate
ActiveWindow.DisplayHeadings = True
Next

Sheets("Current Round").Visible = False
Sheets("Current Round Detailed").Visible = False
Sheets("Current Round Graph").Visible = False
Sheets("Home Graphs").Visible = False
Sheets("Home Detailed Graphs").Visible = False
Sheets("All Rounds").Visible = False
Sheets("LogGraph3").Visible = True
Sheets("View Rounds").Visible = False
Sheets("Search Rounds").Visible = False

Sheets("RecordOfRounds").Visible = xlSheetVeryHidden
Sheets("RecordOfRoundsDetailed").Visible = xlSheetVeryHidden
Sheets("HomeCourse").Visible = xlSheetVeryHidden
Sheets("HomeDetailed").Visible = xlSheetVeryHidden
Sheets("LogGraph1").Visible = xlSheetVeryHidden
Sheets("LogGraph2").Visible = xlSheetVeryHidden
'Sheets("LogGraph3").Visible = xlSheetVeryHidden
Sheets("LogGraph4").Visible = xlSheetVeryHidden
Sheets("LogGraph5").Visible = xlSheetVeryHidden
Sheets("LogGraph6").Visible = xlSheetVeryHidden
Sheets("LogGraph7").Visible = xlSheetVeryHidden
Sheets("SearchRoundsData").Visible = xlSheetVeryHidden
Sheets("SearchRoundsDataDetailed").Visible = xlSheetVeryHidden
Sheets("SearchDataFiltered").Visible = xlSheetVeryHidden
Sheets("SearchDataFilteredDetailed").Visible = xlSheetVeryHidden

Sheets("LogGraph3").Protect Password:=""

Application.ScreenUpdating = True
Application.EnableEvents = True

ActiveWorkbook.Protect Structure:=True, Windows:=False

Application.DisplayAlerts = False

End Sub

Sandy


"Sam Wilson" <(E-Mail Removed)> wrote in message
news:9594B37A-2158-4A0C-ACA4-(E-Mail Removed)...
>
> application.displayalerts = false
>
> "Sandy" wrote:
>
>> How do I hide or disable the cancel button on the normal "Do you want to
>> save the changes etc......" dialog box.
>> I presume code would be inserted into the "Workbook_BeforeClose(Cancel As
>> Boolean)" module.
>>
>> TIA
>> Sandy
>>

 
Reply With Quote
 
Jim Thomlinson
Guest
Posts: n/a
 
      20th Jun 2008
You can not modify the dialog boxes that pop up. The only thing you could do
would be to pre-empt it showing up in the first place. Then you can display
your own form which can look however you want it to...

In the before close event check the saved property. If it is false then you
will need to handle the saving of the file.
--
HTH...

Jim Thomlinson


"Sandy" wrote:

> How do I hide or disable the cancel button on the normal "Do you want to
> save the changes etc......" dialog box.
> I presume code would be inserted into the "Workbook_BeforeClose(Cancel As
> Boolean)" module.
>
> TIA
> Sandy
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Cancel save dialog box Sandy Microsoft Excel Programming 6 20th Jun 2008 02:12 PM
Hide cancel button limors Microsoft Windows 2000 MSI 12 14th Apr 2005 09:07 PM
Disable/Hide button when opening Dialog Box through ASP.NET microsoft Microsoft ASP .NET 1 5th Oct 2004 05:00 PM
Hide Menu Bar / Toolsbar / disable save button? =?Utf-8?B?UGFyYW0=?= Microsoft Excel Worksheet Functions 0 14th Jun 2004 05:45 PM
Print Dialog Cancel Button Todd Huttenstine Microsoft Excel Programming 1 3rd Jun 2004 04:52 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:01 AM.