Bob, unfortunately, the code still does not do what I'm looking for. I can
cancel the Workbook_BeforeClose routine, but the Save dialog box still opens
after that routing is done. I found this
http://msdn2.microsoft.com/microsoft.office.tools.excel.workbook.beforeclose.aspx
but that doesn't do what I'm looking for either, any other ideas?
Thanks again,
RC
>A different approach.
>
[quoted text clipped - 32 lines]
>> TIA
>> RC-
Show me the code that doesn't work.

Signature
HTH
Bob Phillips
(remove nothere from email address if mailing direct)
> Bob, unfortunately, the code still does not do what I'm looking for. I can
> cancel the Workbook_BeforeClose routine, but the Save dialog box still opens
> after that routing is done. I found this
http://msdn2.microsoft.com/microsoft.office.tools.excel.workbook.beforeclose.aspx
> but that doesn't do what I'm looking for either, any other ideas?
>
[quoted text clipped - 37 lines]
> >> TIA
> >> RC-
RC- - 19 Jan 2006 21:27 GMT
It looks like the code you sent originally was just missing the Me.Saved =
True if the user clicked No and Me.Save if the user clicked Yes. The
Me.Saved statement tricks Excel into not prompting to save. Here is the
code that I wrote based on your input:
'Check if the workbook needs to be saved
If ActiveWorkbook.Saved = False Then
'If so, open a dialog box asking to save, not save, or cancel
ans = MsgBox("Do you want to save the changes you made to '" & Me.Name &
"'?", vbYesNoCancel, Me.Parent)
Select Case ans
Case vbCancel: Cancel = True
Case vbYes: Me.Save
Case vbNo: Me.Saved = True
End Select
End If
This works perfectly, thanks for getting me on the right track!
RC-
> Show me the code that doesn't work.
>
[quoted text clipped - 50 lines]
>> >> TIA
>> >> RC-
Bob Phillips - 19 Jan 2006 21:57 GMT
I was only ripping the code off the top of my head, it wasn't meant to be
complete solution <vbg>
Also I forgot this would be in ThisWorkbook, so you could use Me.

Signature
HTH
Bob Phillips
(remove nothere from email address if mailing direct)
> It looks like the code you sent originally was just missing the Me.Saved =
> True if the user clicked No and Me.Save if the user clicked Yes. The
[quoted text clipped - 27 lines]
> > opens
> >> after that routing is done. I found this
http://msdn2.microsoft.com/microsoft.office.tools.excel.workbook.beforeclose.aspx
> >> but that doesn't do what I'm looking for either, any other ideas?
> >>
[quoted text clipped - 41 lines]
> >> >> TIA
> >> >> RC-