![This This](/uploads/1/2/6/2/126292234/494770578.jpg)
The solution regarding deleting the macro workbook worked for me, but the instructions need to be adapted for the Mac (the poster is referring to Windows, but the OP asked about Excel 2011, which is a product for the Mac). Content and Overview Noteboom Productions designed this course for beginners who are new to the Mac or an existing Mac user who may not be familiar with Microsoft Excel for Mac. Knowing how to use a spreadsheet application effectively will result in increased productivity.
New iMac with Excel 2011 opens spreadsheet, but macros will not run. Work was created on Excel for Microsoft OS.After opening, there is a splash screen that reads 'This workbook contains macros. Do you want to disable macros before opening the file' We click Enable Macros. The file opens successfully and the data is available to view. New data can be input in the workbook, but if the macro button is pressed we get the 'Compile error. Cant find project or library' message.
The macros also give us issues on Windows OS installs; however we have found that the fix is to add the MSCOMCT2.OCX file to the appropriate sys32 folder. We also need to be sure there is a valid date in the 'last record' created. The fix on the IOS system has not been as simple.
The iMac code that is first displayed in the debugger is below. The workbook is attached, but all client info has been deleted. This may have some effect on function of the macro, but it is sensitive information.
Compile error. Cant find project or library.
Private Sub UserForm_initialize()
Dim b As Integer
DTPicker1 = Date
DTPicker3 = Date
DTPicker4 = Date
'Sheet3.Visible = xlSheetVisible '(show sheet to make changes)
'Sheet4.Visible = xlSheetVisible '(show sheet to make changes)
If WorksheetFunction.CountA(Cells) > 0 Then
M = ActiveSheet.Cells.Find(what:='*', after:=[A1], _
searchorder:=xlByRows, _
searchdirection:=xlPrevious).Row
End If
This Excel tutorial explains how to open the Visual Basic Editor in Excel 2011 for Mac (with screenshots and step-by-step instructions).
See solution in other versions of Excel:
You can access the VBA environment in Excel 2011 for Mac by opening the Visual Basic editor.
![Includes Includes](/uploads/1/2/6/2/126292234/364151952.png)
First, be sure that the Developer tab is visible in the toolbar in Excel.
The Developer tab is the toolbar that has the buttons to open the VBA editor and create Form Controls like buttons, checkboxes, etc.
To display the Developer tab, click on Preferences under the Excel menu at the top of the screen.
When the Excel Preferences window appears, click on the Ribbon icon in the Sharing and Privacy section.
In the Customize section, check Developer in the list of tabs to show. Then click on the OK button.
Select the Developer tab from the toolbar at the top of the screen. Then click on the Editor option in the Visual Basic group.
Now the Microsoft Visual Basic editor should appear and you can view your VBA code.