(Msg. 1) Posted: Tue Mar 18, 2008 7:11 pm
Post subject: BeforeClose Event Archived from groups: microsoft>public>excel>printing (more info?)
Hi,
I have Excel 2003. I have disabled the builtin commandbars and created a
custom toolbar when a template opens.
I re-instate the builtin commabars in the BeforeClose event. If a user
clicks Cancel do the "Do you want to save changes......" question, the
builtin menu gets re-instated - not good. I have tried
Application.DisplayAlerts = False but that did not prevent the prompt. I
tried Application.SaveChanges = False and that worked but 2 odd things
occurred: User has to click the application close button twice to close
Excel and when you simply open Excel the formula bar isn't displayed.
How do I trap if the user clicks cancel? Code below.
Thanks
LeAnn
Dim oCB As CommandBar
On Error Resume Next
For Each oCB In Application.CommandBars
oCB.Enabled = True
Next oCB
(Msg. 2) Posted: Sun May 18, 2008 3:05 am
Post subject: Re: BeforeClose Event [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
Can you program the BeforeClose event to SAVE first, then the user will Not
be prompted to save the wkbook ?
"LeAnn" <LeAnn DeleteThis @discussions.microsoft.com> wrote in message
news:BD984722-BF9C-4874-A5D2-0DE4625A52C3@microsoft.com...
> Hi,
>
> I have Excel 2003. I have disabled the builtin commandbars and created a
> custom toolbar when a template opens.
>
> I re-instate the builtin commabars in the BeforeClose event. If a user
> clicks Cancel do the "Do you want to save changes......" question, the
> builtin menu gets re-instated - not good. I have tried
> Application.DisplayAlerts = False but that did not prevent the prompt. I
> tried Application.SaveChanges = False and that worked but 2 odd things
> occurred: User has to click the application close button twice to close
> Excel and when you simply open Excel the formula bar isn't displayed.
>
> How do I trap if the user clicks cancel? Code below.
>
> Thanks
> LeAnn
>
>
> Dim oCB As CommandBar
> On Error Resume Next
>
> For Each oCB In Application.CommandBars
> oCB.Enabled = True
> Next oCB
>
> Application.DisplayFormulaBar = True
>
All times are: Eastern Time (US & Canada) (change)
Page 1 of 1
You can post new topics in this forum You can reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum