+ Reply to Thread
Results 1 to 3 of 3

VBA Compile Error appears with upgrade to Office 2013 from Office 2010

  1. #1
    Registered User
    Join Date
    10-27-2014
    Location
    UK
    MS-Off Ver
    Office 10
    Posts
    25

    VBA Compile Error appears with upgrade to Office 2013 from Office 2010

    Please can anyone help or advise?
    I've an old Macro-enabled workbook containing an simple interactive 'form' that ran well for years on Office 2010 (Excel Ver 14, Win 8), but now gives a Compile error whenever the workbook is opened in Office 2013 (Excel Ver 15, Win 10).

    The exact error is: 'Compile Error: Method or Data Member Not Found' and it highlights CommandButton1 in the line 'Sheet1.CommandButton1.Enabled= True'.

    Please can anyone give me some hint as to my error?
    Is it possible the CommandButtons are somehow no longer, or differently supported in Office 2013 compared to previous versions of Office?



    The module 'ThisWorkbook' which contains the error is simply:

    Private Sub Workbook_Open()
    Dim wks As Worksheet
    For Each wks In ThisWorkbook.Worksheets
    wks.Protect Password:="protect", UserInterfaceOnly:=True
    Next wks

    'Disable Scroll Bars?

    'text colour over-ride
    Sheet1.Range("AJ39") = 1
    Calculate
    Sheet1.CommandButton1.Enabled = True
    Sheet1.CommandButton2.Enabled = False

    Sheet1.ComboBox2.Enabled = True
    Sheet1.ComboBox3.Enabled = True

    Sheet1.Range("H7:AA7").Interior.Color = vbGrey

    Sheet1.Range("M2:N2") = ""

    Sheet2.Visible = False

    End Sub

  2. #2
    Forum Expert nigelog's Avatar
    Join Date
    12-14-2007
    Location
    Cork, Ireland
    MS-Off Ver
    Office 365 Windows 10
    Posts
    2,287

    Re: VBA Compile Error appears with upgrade to Office 2013 from Office 2010

    Can you add code tags to your code - see forum rules and can you attach sample workbook as impossible to say without finding the problem

  3. #3
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    2016 primarily
    Posts
    7,644

    Re: VBA Compile Error appears with upgrade to Office 2013 from Office 2010

    I suspect you're running into the issue where two computers have different versions of the Forms library - it's a common problem with ActiveX controls on worksheets. See here - ignore the patch links at the top, and read the instructions for clearing out exd files.
    Rory

+ 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. [SOLVED] Hyperlink OK in Office for Mac 2011 but problems in Office 2013
    By irose_57 in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 11-15-2017, 11:02 PM
  2. Moving from Office 2003 to Office 2013 - code no longer works
    By GeorgeC47 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-27-2014, 11:20 AM
  3. Open PDf specific page, work with office 2007 but not on office 2013
    By haktak in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-10-2014, 01:58 AM
  4. Office 2010 upgrade
    By Spfsnana in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-17-2012, 10:28 AM
  5. An upgrade to 64bit Office 2010 creates a function error in a standard module?
    By jonvanwyk in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 01-26-2012, 10:05 AM
  6. [SOLVED] New Macro error after Office Upgrade
    By Marc in forum Excel General
    Replies: 9
    Last Post: 03-03-2006, 05:15 PM
  7. Is it worthwhile to upgrade Office 2000 to Office 2003?
    By Tim Zych in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 04-26-2005, 03:06 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