+ Reply to Thread
Results 1 to 4 of 4

[SOLVED] why doesnt cancel=true always work?

Hybrid View

  1. #1
    Duncan
    Guest

    [SOLVED] 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. #2
    Zone
    Guest

    Re: 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. #3
    NickHK
    Guest

    Re: 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" <[email protected]> wrote in message
    news:[email protected]...
    > 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. #4
    Duncan
    Guest

    Re: 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" <[email protected]> wrote in message
    > news:[email protected]...
    > > 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 to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1