The first option on the View menu of the Office 2011 for Mac Visual Basic Editor (VBE) is the Code option, which is grayed out until you make at least one Code window visible in the VBE. A common way to open a new code window is to use Insert→Module. A module is like a new word processing document window — it’s blank. Below you will find a list of basic macro examples for common Excel automation tasks. Copy and Paste a Row from One Sheet to Another. This super simple macro will copy a row from one sheet to another. Sub PasteOneRow 'Copy and Paste Row Sheets('sheet1').Range('1:1').Copy Sheets('sheet2').Range('1:1') Application.CutCopyMode = False End Sub. There are several ways to run a macro in Microsoft Excel. A macro is an action or a set of actions that you can use to automate tasks. Macros are recorded in the Visual Basic for Applications programming language. You can always run a macro by clicking the Macros command on the Developer tab on the ribbon. Depending on how a macro is assigned. Use VBA add-ins and macros that you developed for Office for Windows with Office for Mac. Applies to: Excel for Mac PowerPoint for Mac Word for Mac Office 2016 for Mac. If you are authoring Macros for Office for Mac, you can use most of the same objects that are available in VBA for Office. For information about VBA for Excel, PowerPoint.
Oct 26, 2020 • Filed to: Recover & Repair Files • Proven solutions
When using MS Excel document or MS Access that assimilate functions or buttons which need VBA (Visual Basic Applications) for the Macros to perform some assigned task, the user may get a compilation error 'Can't find project or library.'
Part 1: What is the cause of this Error?
- This error is usually caused by the user's MS Access or MS Excel program. The reason is that the program has a reference to an object or type of library which is missing and hence not found by the program. Accordingly, the program cannot use VB or Micro based functions or buttons. Therefore an error message is sent.
- Sometimes a library may be toggled or toggled off, causing a missing link between the library and program code. So the compilation error is issued.
- Since there are standard libraries, so missing a library sounds a bit of the least chance. The other possible reason, in that case, is that library miss-match is the cause of the error. For example, the user may have a library (sat Outlook) version of 2007, but the code's reference may be looking for the 2010 version of that specific library. So the program fails to find the corresponding library, thus issuing this compilation error.
- Another scenario for the same error message concerns the use of Microsoft XP, which includes a reference to web service in the VBA project. When you run this project in MS Office 2003, the same compilation error appears. The reason is the same, i.e., an object or type of library is missing (or not found).
Part 2: How to Repair Corrupt Excel File
![For For](/uploads/1/3/4/2/134235732/480507094.png)
Some solutions to rectify the problem or repair corrupted Excel files are always there for different situations. Like finding out the missing library or the cause of mismatch if it exists. The library is then added, or the code may be rechecked to link to the appropriate library.
How can it be done?
Following the steps:
Step 1. Open the MS Excel file, giving an error message.
Step 2. Ensure that the sheet that has defined functions or buttons is selected.
Step 3. Press 'ALT and F11 keys' for VB Editor in a new window (as below).
Step 4. Click on the Tools menu and then select References from the pulled down menu, as shown
Step 5. Following dialog box will display 'Missing object library or type' is indicated, as shown below
Step 6. As in the above display, if a checkmark exists with the missing library, uncheck it and click OK
Step 7. Exit and save the original Excel file.
Now check to ensure respective functions are working properly.
Video Tutorial to Fix Can't Find Project or Library Error
Part 3: Repair MS Excel File with Excel Repair Tool
Third-party Excel file repair software is there to resolve all such matters quickly and accurately. One of the Best Excel file Repair software to repair and recover damaged/ corrupt Excel files is described below.
This Excel file repair software is available for single as well as multiple systems. The file repairing tool supports all versions of windows and supports Excel 2011 for Mac. This permits the repair of corrupted Excel file (.XLS and .XLSX) and restores all the data from corrupt to a new Excel file.
- Recovers all kinds of data stored in damaged excel files such as tables, charts, formulas, comments, images, etc.
- Restore all of your corrupted excel files to their original standing.
- Preview the repaired excel file in real-time, see how much of the file has been recovered as it is being repaired.
- All kinds of MS office corruption errors (for XLS and XLSX files only) can be handled with this tool.
- This excel file repair tool can be used on both Windows and Mac platforms to repair corrupt excel file.
- All kinds of MS office corruption errors (for XLS and XLSX files only) can be handled with this tool.
- This excel file repair tool can repair damaged files of all versions from 2000 to 2016, including 2000, 2003, 2007, 2010, 2013, etc.
Step 1 Select a corrupt Excel file from drive and search.
Step 2 Choose one or all corrupt Excel files to start to repairing process.
Step 3 Preview the repaired Excel file.
Step 4 Select a preferred location to save the repaired Excel file.
In addition to Excel Repair Tool or Excel file repair software, a few tips may help quick fixes (to recover or repair corrupted Excel file).
Case 1. When an Excel file is open, try any one of the following.
- Try on a different computer
- Switch off Auto-save.
- Turn off the file-sharing.
- Do not run Excel from a floppy.
- Please save the file as a web page and reopen it as an Excel file.
Case 2. When Excel cannot open the file, try one of the following.
- Open the corrupt file on the hard-drive. Copy from floppy.
- Find .xlb file. Also, keep a backup. Delete .xlb. Restart Excel.
- Open file in MS Word or Notepad. That will let you recover data but not formatting.
- With MS Excel 97/2000 viewer, you can view the data and print. Open the file using this free program to recover data. This program will recover formatting as well as cell values.
- Use Excel XP. This has better options for recovery.
Recover & Repair Files
Excel Visual Basic Macro Security
- Recover Document Files
- Repair Document Files
- Recover & Repair More
- Clear & Delete File