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
Bookmarks