The XML-based workbook format for Microsoft Excel 2008 for Mac, Microsoft Excel for Mac 2011, and Excel 2007 and Excel 2010 for Windows that preserves VBA macro code and Excel 4.0 macro sheets. VBA macros do not run in Excel 2008. Excel Macro-Enabled Template (.xltm).
Visual Basic for Applications support was dropped in Microsoft Office 2008 for Mac, then reintroduced in Office for Mac 2011. 60 Microsoft tried in the mid-1990s to port Office to RISC processors such as NEC / MIPS and IBM / PowerPC, but they met problems such as memory access being hampered by data structure alignment requirements.
Office for Mac 2011 marks the return of Outlook for Mac and Visual Basic for Applications to the Apple desktop platform. The office suite, which is only available for Intel-based Macs running Mac.
Office 2011 for Mac’s Visual Basic Editor (VBE) is very much like a specialized word processor combined with an organization tool and some special tools to help you make visual basic code. To display the VBE using the Ribbon, click the Developer tab, and in the Visual Basic group, and click Editor. From the menu bar, choose Tools→Macro→Visual Basic Editor.
The VBE has menus, toolbars, and keyboard shortcuts, but there is no Ribbon. As with Office applications, VBE toolbars and menus are context sensitive.
As with Office applications, you can turn VBE interface components on and off using the View menu. Be sure to toggle on the Debug, Edit, and Standard toolbars as shown. Notice that keyboard shortcuts are displayed on the View menu.
The Standard toolbar in VBE, in Office 2011 for Mac
Some of the controls on the Standard toolbar in VBE are familiar text-editing controls. The rest are specific to working within the VBE.
Host Application: Takes you out of the VBE and displays the document, spreadsheet, or presentation view.
Insert: Inserts into the current Project a new UserForm, Module, Class Module, or Procedure. This button remembers which you inserted last and offers the most recently used as its default.
Tips:.You can also move a message to your Junk E-mail folder or block a sender from your Inbox:.To classify a message as junk and move it to your Junk E-mail folder, Ctrl+click or right-click a message header and then click Junk Mail Mark as Junk.To classify a message as junk and block the sender, Ctrl+click or right-click a message header and then click Junk Mail Block Sender.Add important people to your Outlook contacts. When a contact is saved in your contacts list, Outlook does not classify messages from that email address as junk. Safe for mac. Note: Unless the level of junk e-mail protection is set to None, legitimate messages might be classified as 'junk' and put in the Junk E-mail folder.
Save: Saves the document, workbook, or presentation of the Project that is currently selected in the Project Explorer.
Cut, Copy, Paste, and Find: Work similar to other applications.
Run: Click into a module (procedure) and then click Run to run your code.
Break: Interrupts code execution. Click Run or press F5 to resume, or click Step Over on the Debug toolbar to execute one command at a time.
Reset: When in Break mode, Reset ends the break and resets so that if you click Run again, code execution starts at the beginning.
Design Mode: In Design mode, the Break and Reset commands are disabled.
Project Explorer: Switches focus to the Project Explorer.
Properties Window: Displays the Properties window.
Object Browser: Displays the Object Browser.
Help: Displays VBA help.
Line and Column: You can think of a code module as a grid, with each character that you type at a specific location (line and column) within the grid. The cursor’s position is always displayed here. This is blank if your selection cursor is not in a code module.
The VBE Edit toolbar in Office 2011 for Mac
This toolbar focuses on editing code and making it easier to read with indenting.
Indent/Outdent: Applies to selection. Indenting is not automatic.
Breakpoint toggle: Adds or removes a breakpoint at the selection and is represented by a circle in the margin. If you run code, execution halts at a breakpoint. Press F5 or click Run to resume. Clicking in the margin adds a breakpoint. Clicking a breakpoint in the margin removes it.
Comment/Uncomment: Comment turns selection into a comment, which is text that does not execute when run.
Bookmark Toggle: Sets or removes a bookmark, represented by an oval in the margin.
Next Bookmark/Previous Bookmark: Navigation for bookmarks.
Clear All Bookmarks: Removes all bookmarks from the module.
The Office 2011 for Mac VBE Debug toolbar
The VBE Debug toolbar shares several tools in common with the Standard and Editing toolbars.
Step Into: Sets code execution at the first line of code.
Step Over: Executes one line of code each time it is pressed. This is the same as Command-Shift-O.
Step Out: Stops code executing. Same as Command-Shift-T.
Immediate Window: Displays the Immediate Window, where you can enter a code snippet followed by a question mark to see its result.
Call Stack: Displays the Call Stack dialog, an advanced debugging tool that you won’t need to worry about until you’re an expert.
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. Nothing interesting happens until you start writing. The same VBE features apply to Excel, Word, and PowerPoint.
Notice that horizontal lines separate the declarations section and each of the two macros. The lines are drawn automatically by the VBE. Each macro section is called a procedure. More about Code windows:
Object pop-up menu: This is the pop-up menu on the left side of the window; it provides a list of shortcuts to objects.
Procedure pop-up menu: This is the pop-up menu on the right side of the window; it provides a list of shortcuts to procedures and declarations. When an object is chosen in the Object pop-up menu, the procedures that are applicable to the selected object are displayed.
Declarations section: (Optional) Public declarations appear at the top of a Code module.
Macro modules: Each macro, or procedure, is separated by a line.
Procedure view button: Click to limit the display to the declaration or procedure section that has the insertion cursor.
Full Module view button: Click to display all Code window contents.
Writing VBA code in Office 2011 for Mac
As with a word processor, in a Code window the editor knows which commands are legal and which are not, and the editor gives you feedback as you type. New for VBA (Visual Basic for Applications) in Office 2011 is Intellisense, a feature that helps you automatically complete your code as you type. To see how Intellisense works, declare a public variable in an empty Code window:
Choose Insert→Module to display a blank Code window.
Type the following code exactly as you see it here and press Return at the end of the line:
Visual Basic For Applications Download
Notice that after you type as, a pop-up menu appears. This is Intellisense at work. If you know what you want to type, you can keep right on typing. But if you want to see all the possible options, use the pop-up menu.
Getting help with VBA code in Office 2011 for Mac
You can rely on the following five principal sources of code examples, syntax help, and general programming assistance:
Office For Mac Visual Basic Software
Macro recorder: In Excel and Word, you can record your actions and then look at the code that was recorded inside the modules.
Object browser: A handy treasure trove of information about the objects, methods, and properties of Office.
Help: The Help system within the VBE is minimal. Microsoft plans to provide VBA help for Excel only.
Internet: Search the Internet for VBA code examples.
Books on VBA: You can find plenty of books about VBA.