Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Workbook_BeforeClose(Cancel As Boolean) - Cancel won't work | Setting up and Configuration of Excel | |||
Disabling 'Cancel' option when saving work (Yes/No/Cancel) | Excel Programming | |||
Another way to suppress print besides Cancel = True? | Excel Programming | |||
BeforeDoubleClick Cancel=True not working | Excel Programming | |||
Setting Cancel = True in WorkbookBeforePrint | Excel Programming |