Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 290
Default why doesnt cancel=true always work?

Hi all,

General niggling point, ive tried to use cancel=true to stop things
happening (like close event and so on) but it always just carried on
and closed/saved/whatever. I just got a little wound up and found ways
around it and then forgot all about it till recently...I tried it on
another pc (one round a friends house) and noticed that it
worked.......strange....

Does anyone know why this is intermittent?

Duncan

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 269
Default why doesnt cancel=true always work?

Duncan, since no one else is answering this, I'll give it a shot. Put
a breakpoint on your line of code that is supposed to cancel by
clicking on the gray area to the left of it. If the code doesn't break
when you run it, then execution is not reaching that point. If it does
break and you debug, you should be able to rest the cursor over your
variables and get values for them. Might be a starting point.
James
Duncan wrote:
Hi all,

General niggling point, ive tried to use cancel=true to stop things
happening (like close event and so on) but it always just carried on
and closed/saved/whatever. I just got a little wound up and found ways
around it and then forgot all about it till recently...I tried it on
another pc (one round a friends house) and noticed that it
worked.......strange....

Does anyone know why this is intermittent?

Duncan


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default why doesnt cancel=true always work?

Duncan,
It does work, but for some reason the code is not being executed as you
think.
Follow James' advice to see if the events is being fired.

If not, the run
Application.EnableEvents=true
and try again.

NickHK

"Duncan" wrote in message
oups.com...
Hi all,

General niggling point, ive tried to use cancel=true to stop things
happening (like close event and so on) but it always just carried on
and closed/saved/whatever. I just got a little wound up and found ways
around it and then forgot all about it till recently...I tried it on
another pc (one round a friends house) and noticed that it
worked.......strange....

Does anyone know why this is intermittent?

Duncan



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 290
Default why doesnt cancel=true always work?

Thank you Nick and James for your suggestions,

I will have a go at seeing which events are not being fired through
debugging, Ive noticed that depending on whether I close through my
form or through Excel the workbook_close event doesnt always fire, I
will look into it......

Many thanks

Duncan





NickHK wrote:

Duncan,
It does work, but for some reason the code is not being executed as you
think.
Follow James' advice to see if the events is being fired.

If not, the run
Application.EnableEvents=true
and try again.

NickHK

"Duncan" wrote in message
oups.com...
Hi all,

General niggling point, ive tried to use cancel=true to stop things
happening (like close event and so on) but it always just carried on
and closed/saved/whatever. I just got a little wound up and found ways
around it and then forgot all about it till recently...I tried it on
another pc (one round a friends house) and noticed that it
worked.......strange....

Does anyone know why this is intermittent?

Duncan


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
Workbook_BeforeClose(Cancel As Boolean) - Cancel won't work gpmichal Setting up and Configuration of Excel 1 May 12th 09 02:33 AM
Disabling 'Cancel' option when saving work (Yes/No/Cancel) [email protected] Excel Programming 0 July 11th 06 09:28 PM
Another way to suppress print besides Cancel = True? mikeburg[_56_] Excel Programming 4 December 5th 05 02:49 PM
BeforeDoubleClick Cancel=True not working Reggie Excel Programming 1 September 20th 05 03:43 AM
Setting Cancel = True in WorkbookBeforePrint Tony Excel Programming 0 December 21st 03 10:37 PM


All times are GMT +1. The time now is 07:41 PM.

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"