Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 270
Default Disable or hide Cancel button on Save dialog box

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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 523
Default Disable or hide Cancel button on Save dialog box


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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 270
Default Disable or hide Cancel button on Save dialog box

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 Structu=True, Windows:=False

Application.DisplayAlerts = False

End Sub

Sandy


"Sam Wilson" wrote in message
...

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

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default Disable or hide Cancel button on Save dialog box

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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Cancel save dialog box Sandy Excel Programming 6 June 20th 08 02:12 PM
Cancel Button on file save lwm Excel Programming 3 January 19th 08 02:35 AM
disable save as dialog box Dion Excel Programming 2 October 5th 06 09:11 PM
Print Dialog Cancel Button Todd Huttenstine Excel Programming 1 June 3rd 04 04:52 PM
Disable Cancel button R Avery Excel Programming 2 February 9th 04 09:41 PM


All times are GMT +1. The time now is 12:53 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"