+ Reply to Thread
Results 1 to 6 of 6

Running Macros based on Worksheet changes in Excel 2007

  1. #1
    Registered User
    Join Date
    06-03-2009
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2003, Excel 2007
    Posts
    59

    Running Macros based on Worksheet changes in Excel 2007

    Hello,

    I ran into a problem with a macro created in Excel 2002 that runs when the values of certain cells in the worksheet changes using
    Please Login or Register  to view this content.
    However, when I tested this in Excel 2007, it doesn't initiate the macro. Whats causing it to not work in 2007 even though it works in 2002?

    Thanks.
    Last edited by Kaigi; 04-15-2010 at 05:52 PM.

  2. #2
    Forum Expert
    Join Date
    12-10-2006
    Location
    Sydney
    MS-Off Ver
    Office 365
    Posts
    3,565

    Re: Running Macros based on Worksheet changes in Excel 2007

    Hi Kaigi,

    Works fine for me

    Are you sure the code (event macro) is assigned to the worksheet in question and not just put into a stand alone module?

    Regards,

    Robert
    ____________________________________________
    Please ensure you mark your thread as Solved once it is. Click here to see how
    If this post helps, please don't forget to say thanks by clicking the star icon in the bottom left-hand corner of my post

  3. #3
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Running Macros based on Worksheet changes in Excel 2007

    If in XL2007 the code is in the appropriate object in VBE (per prior post) check you have Events enabled..

    To test this enter the below into the Immediate window:

    Please Login or Register  to view this content.
    If it returns False add the following line

    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    06-03-2009
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2003, Excel 2007
    Posts
    59

    Re: Running Macros based on Worksheet changes in Excel 2007

    Thanks for your responses.

    The event macro is in the worksheet itself and not in a separate module.

    Is there a way to check whether events are enabled without going into the code? The user is supposed to be able to just open the file and any changes to the worksheet should trigger the macro, so for normal use, Excel doesn't run any macros where I can enter the code to enable events before the event macro is to be triggered.

  5. #5
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Running Macros based on Worksheet changes in Excel 2007

    First off, in 2007, have you enabled Macros ?
    2007 security is slightly different, see: http://office.microsoft.com/en-us/ex...969191033.aspx

    Regards Events... Events would pretty much always be Enabled ... however, if you have code present that toggles this setting and which has at some point within the XL session failed and in so doing failed to reinstate Events (ie unhandled error) then it's possible Events are disabled.

    First though - check your security settings.

  6. #6
    Registered User
    Join Date
    06-03-2009
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2003, Excel 2007
    Posts
    59

    Re: Running Macros based on Worksheet changes in Excel 2007

    I had previously set the security to enable all macros because before, even though it was set to Disable all macros with notification, I didn't get notified and they would just be disabled. However, even after the security was set to enable all, it didn't work yesterday.

    I tried to get the macro to run later again today and it worked. I'm not sure what it was that was stopping it before, but it seems to be working fine now. Thanks.

+ 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