Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > microsoft.public.excel.programming > #110996
| Path | csiph.com!weretis.net!feeder6.news.weretis.net!feeder.usenetexpress.com!feeder-in1.iad1.usenetexpress.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!buffer1.nntp.dca1.giganews.com!nntp.newsgroupbanter.com!news.newsgroupbanter.com.POSTED!not-for-mail |
|---|---|
| NNTP-Posting-Date | Fri, 28 Jun 2019 06:49:02 -0500 |
| From | FrancisM <FrancisM.175bb428@excelbanter.com> |
| Newsgroups | microsoft.public.excel.programming |
| Subject | Re: Using the red X (Upper right hand corner) for another purpose. |
| Date | Fri, 28 Jun 2019 12:32:00 +0100 |
| Message-ID | <FrancisM.175bb428@excelbanter.com> (permalink) |
| Organization | ExcelBanter.com |
| User-Agent | |
| X-Newsreader | |
| X-Originating-IP | |
| References | <FrancisM.1752ea28@excelbanter.com> <qemo3m$cp9$1@dont-email.me> <FrancisM.17566e28@excelbanter.com> <FrancisM.17567c38@excelbanter.com> <qer2kp$507$1@dont-email.me> <FrancisM.1756dea8@excelbanter.com> <qerb2d$psq$1@dont-email.me> <FrancisM.1757bfa8@excelbanter.com> <FrancisM.1757f7e8@excelbanter.com> <FrancisM.17596589@excelbanter.com> <FrancisM.175ab708@excelbanter.com> |
| Lines | 57 |
| X-Usenet-Provider | http://www.giganews.com |
| X-Trace | sv3-2nUOGKAty6cABl7U8vix9Ksl2CZtdReU8BKTUpcPw929+gJG4Y+kJfGQ0uLbtJowf6afLNyHKSxAsjV!DVFeElWBQXIsgphcX3bTW4xgKvFn2L0ysCh28D5xllRzFJy+w7aVp57WrNB9s04qEM0o3ovPHgV4!vgX+akhEHg== |
| X-Complaints-To | abuse@newsgroupbanter.com |
| X-Abuse-and-DMCA-Info | Please be sure to forward a copy of ALL headers |
| X-Abuse-and-DMCA-Info | Otherwise we will be unable to process your complaint properly |
| X-Postfilter | 1.3.40 |
| X-Original-Lines | 45 |
| X-Original-Bytes | 2960 |
| Xref | csiph.com microsoft.public.excel.programming:110996 |
Show key headers only | View raw
I don't know if that link worked, so here is the current code:
This is located in ThisWorkbook & does work.
Public fMacro As Boolean
Private Sub Workbook_BeforeClose(cancel As Boolean)
'Part of code to call a pop up calendar.
On Error Resume Next
Application.OnKey "+^{C}"
Application.CommandBars("Cell").Controls("Insert Date").Delete
Dim Msg As String, Ans As Variant
'Cancels The Red X on both the Application & the "Click....."
window.
If Not fMacro Then cancel = True
'Reminds the user to click Exit button to close.
Msg = "Click Exit to close."
Ans = MsgBox(Msg, vbInformation, "Vocational Services
Database - " & ActiveSheet.Name)
Select Case Ans
Case vbYes
End Select
End Sub
This portion of the code is located in Module 1:
Option Explicit
Sub Exit_Referrals()
Dim Msg As String, Ans As Variant
Msg = "Would you like to Exit the Referral Workbook?"
Ans = MsgBox("Would you like to Exit the Referral Workbook?" & vbCr,
vbYesNo, "Vocational Services Database - " & ActiveSheet.Name)
Select Case Ans
ThisWorkbook.fMacro = True
Case vbYes
Sheets("TOC").Select
Application.Calculation = xlCalculationAutomatic
ThisWorkbook.Save
Application.Quit
End Select
End Sub
If I use the active X Button (the way I want to close) a error message
arrears:
Compile error: "Statements and labels invalid between Select Case and
first Case" What can you suggest that I look at?
I tried changing ThisWorkbook.fMacro = True to If Not
fMacro Then cancel = False
The message I get now is Variable not defined. Any suggestions?
--
FrancisM
Back to microsoft.public.excel.programming | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Using the red X (Upper right hand corner) for another purpose. FrancisM <FrancisM.1752ea28@excelbanter.com> - 2019-06-21 19:57 +0100
Re: Using the red X (Upper right hand corner) for another purpose. GS <gs@v.invalid> - 2019-06-22 22:28 -0400
Re: Using the red X (Upper right hand corner) for another purpose. FrancisM <FrancisM.17566e28@excelbanter.com> - 2019-06-24 12:48 +0100
Re: Using the red X (Upper right hand corner) for another purpose. FrancisM <FrancisM.17567c38@excelbanter.com> - 2019-06-24 13:20 +0100
Re: Using the red X (Upper right hand corner) for another purpose. GS <gs@v.invalid> - 2019-06-24 13:52 -0400
Re: Using the red X (Upper right hand corner) for another purpose. FrancisM <FrancisM.1756dea8@excelbanter.com> - 2019-06-24 20:08 +0100
Re: Using the red X (Upper right hand corner) for another purpose. GS <gs@v.invalid> - 2019-06-24 16:16 -0400
Re: Using the red X (Upper right hand corner) for another purpose. FrancisM <FrancisM.1757bfa8@excelbanter.com> - 2019-06-25 12:23 +0100
Re: Using the red X (Upper right hand corner) for another purpose. FrancisM <FrancisM.1757f7e8@excelbanter.com> - 2019-06-25 15:54 +0100
Re: Using the red X (Upper right hand corner) for another purpose. FrancisM <FrancisM.17596589@excelbanter.com> - 2019-06-26 18:32 +0100
Re: Using the red X (Upper right hand corner) for another purpose. GS <gs@v.invalid> - 2019-06-26 16:36 -0400
Re: Using the red X (Upper right hand corner) for another purpose. FrancisM <FrancisM.175a62a8@excelbanter.com> - 2019-06-27 12:07 +0100
Re: Using the red X (Upper right hand corner) for another purpose. GS <gs@v.invalid> - 2019-06-27 12:37 -0400
Re: Using the red X (Upper right hand corner) for another purpose. FrancisM <FrancisM.175ab708@excelbanter.com> - 2019-06-27 17:59 +0100
Re: Using the red X (Upper right hand corner) for another purpose. FrancisM <FrancisM.175bb428@excelbanter.com> - 2019-06-28 12:32 +0100
Re: Using the red X (Upper right hand corner) for another purpose. GS <gs@v.invalid> - 2019-06-28 12:16 -0400
Re: Using the red X (Upper right hand corner) for another purpose. FrancisM <FrancisM.175c0888@excelbanter.com> - 2019-06-28 18:28 +0100
Re: Using the red X (Upper right hand corner) for another purpose. GS <gs@v.invalid> - 2019-06-28 15:00 -0400
Re: Using the red X (Upper right hand corner) for another purpose. GS <gs@v.invalid> - 2019-06-28 15:30 -0400
Re: Using the red X (Upper right hand corner) for another purpose. FrancisM <FrancisM.175fa8a8@excelbanter.com> - 2019-07-01 12:07 +0100
Re: Using the red X (Upper right hand corner) for another purpose. GS <gs@v.invalid> - 2019-07-01 08:09 -0400
Re: Using the red X (Upper right hand corner) for another purpose. FrancisM <FrancisM.17614078@excelbanter.com> - 2019-07-02 17:26 +0100
csiph-web