+ Reply to Thread
Results 1 to 4 of 4

Code not working in Office 2010 and Office 2016

  1. #1
    Forum Contributor
    Join Date
    03-13-2008
    MS-Off Ver
    Office 2013
    Posts
    118

    Code not working in Office 2010 and Office 2016

    Hi All, I have below code which i created in Excel 2013, it is working fine in my computer, but it is not working in any other computer who has MS office 2010 or Office 2016, they are getting "Compile Error in Module 1". I not able to figure out where is the issue. when tring to do Debug it showing me error on.. "Cancel = True". Below is the complete code.

    Any help in this will be appreciated. Thanks in advance.

    Please Login or Register  to view this content.

  2. #2
    Administrator JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Code not working in Office 2010 and Office 2016

    Cancel= True is typically found in sheet module event macros, not in regular code modules. Perhaps if you declared it? Shot in the dark:

    Please Login or Register  to view this content.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    “None of us is as good as all of us” - Ray Kroc
    “Actually, I *am* a rocket scientist.” - JB (little ones count!)

  3. #3
    Forum Guru
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,122

    Re: Code not working in Office 2010 and Office 2016

    If you have declared all your varaibles, it would help you to spot an obvious error.
    I have 2010. I run the code and did not get an error.

    Please Login or Register  to view this content.
    If the code errors, It might be on this line( though it does not error)

    mymenubar.Controls("Edit").Controls("Delete sheet").Visible = False
    The menus might have been changed.

  4. #4
    Forum Contributor
    Join Date
    03-13-2008
    MS-Off Ver
    Office 2013
    Posts
    118

    Re: Code not working in Office 2010 and Office 2016

    Hey thank a lot.. it fixed it by adding the Dim as u suggested...

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 2
    Last Post: 05-24-2016, 10:43 PM
  2. What's New and Improved in Office 2016 for Office 365
    By AlKey in forum The Water Cooler
    Replies: 5
    Last Post: 05-06-2016, 07:52 AM
  3. Conditional formatting with udf issues with Office 2016 / Office 365
    By andikeep2580 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-22-2016, 10:58 AM
  4. Replies: 1
    Last Post: 01-31-2016, 07:46 AM
  5. [SOLVED] Office 2016 cell comments on hover not working
    By leaning in forum Excel General
    Replies: 1
    Last Post: 01-10-2016, 11:20 PM
  6. Update from Office 97 to Office Professional Plus 2016
    By billd73 in forum Excel General
    Replies: 0
    Last Post: 12-28-2015, 05:15 PM
  7. [SOLVED] How do i change a VBA code complied on office 2007 Bit 32 to Office 2010 Bit 64
    By nathandavies in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-18-2014, 12:17 PM

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