PC Review


Reply
Thread Tools Rate Thread

Closing application problem

 
 
Sandy
Guest
Posts: n/a
 
      24th Jun 2008
Hi,
Excel 2007 - Two simple macros.
(I would suggest trying these out).

Private Sub Workbook_Open()

Application.DisplayFullScreen = True
Application.DisplayFormulaBar = False

End Sub

Private Sub Workbook_BeforeClose(cancel As Boolean)

Application.DisplayFullScreen = False
Application.DisplayFormulaBar = True

End Sub

The problem is that when a change has been made to the workbook and the user
clicks cancel when the save dialog appears there is then no option to close
down the application.

Is there any way to force the entire application window to be viewed in
order that the close button can be selected.

Sandy

 
Reply With Quote
 
 
 
 
Clarindo
Guest
Posts: n/a
 
      24th Jun 2008
Try it,


Private Sub Workbook_BeforeClose(cancel As Boolean)
If Not ActiveWorkbook.Saved Then
If (MsgBox("Save the work?", vbYesNo)) = 6 Then
ActiveWorkbook.Save
Else
ActiveWorkbook.Saved = True
End If
Application.DisplayFullScreen = False
Application.DisplayFormulaBar = True
End If
End Sub




"Sandy" <(E-Mail Removed)> escreveu na mensagem
news:E1612D07-373E-4517-9B4E-(E-Mail Removed)...
> Hi,
> Excel 2007 - Two simple macros.
> (I would suggest trying these out).
>
> Private Sub Workbook_Open()
>
> Application.DisplayFullScreen = True
> Application.DisplayFormulaBar = False
>
> End Sub
>
> Private Sub Workbook_BeforeClose(cancel As Boolean)
>
> Application.DisplayFullScreen = False
> Application.DisplayFormulaBar = True
>
> End Sub
>
> The problem is that when a change has been made to the workbook and the
> user clicks cancel when the save dialog appears there is then no option to
> close down the application.
>
> Is there any way to force the entire application window to be viewed in
> order that the close button can be selected.
>
> Sandy





 
Reply With Quote
 
Sandy
Guest
Posts: n/a
 
      25th Jun 2008
Hi Clarindo
This certainly takes the 'Cancel' aspect out of the options.
Thank you it works well.
Sandy

"Clarindo" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Try it,
>
>
> Private Sub Workbook_BeforeClose(cancel As Boolean)
> If Not ActiveWorkbook.Saved Then
> If (MsgBox("Save the work?", vbYesNo)) = 6 Then
> ActiveWorkbook.Save
> Else
> ActiveWorkbook.Saved = True
> End If
> Application.DisplayFullScreen = False
> Application.DisplayFormulaBar = True
> End If
> End Sub
>
>
>
>
> "Sandy" <(E-Mail Removed)> escreveu na mensagem
> news:E1612D07-373E-4517-9B4E-(E-Mail Removed)...
>> Hi,
>> Excel 2007 - Two simple macros.
>> (I would suggest trying these out).
>>
>> Private Sub Workbook_Open()
>>
>> Application.DisplayFullScreen = True
>> Application.DisplayFormulaBar = False
>>
>> End Sub
>>
>> Private Sub Workbook_BeforeClose(cancel As Boolean)
>>
>> Application.DisplayFullScreen = False
>> Application.DisplayFormulaBar = True
>>
>> End Sub
>>
>> The problem is that when a change has been made to the workbook and the
>> user clicks cancel when the save dialog appears there is then no option
>> to
>> close down the application.
>>
>> Is there any way to force the entire application window to be viewed in
>> order that the close button can be selected.
>>
>> 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
Problem closing down the application =?Utf-8?B?UGF0cmljayBG?= Microsoft C# .NET 5 17th Aug 2006 02:35 AM
Closing another Application problem =?Utf-8?B?VGlt?= Microsoft Access VBA Modules 3 18th Nov 2005 06:09 PM
Re: Problem closing application during logoff... haferka Windows XP General 1 30th Aug 2005 09:33 PM
Potential problem when closing application - help! James Radke Microsoft Dot NET Framework Forms 3 10th Feb 2004 05:01 AM
Problem Closing Secured Application Bruce Microsoft Access Security 1 16th Oct 2003 11:56 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:39 PM.