Mar 20, 2012 - The Apple guy in the store told me that all macros run well, but when I open a. A Macro (windows Excel 2007) I got the warning message to able. Am facing alternatives I don't love: Add Windows/Bootcamp to mac along with PC version of excel, or upgrade to Excel 2016 or 365 on mac which is unacceptable since macro recording is crippled without ability to record relative references on the macros.
By 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. Exploring the Office 2011 VBE Code Window 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: Public MyVariable as String 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:. 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.
Hi, I encountered a crash in Mac Excel 2011 running on OS X Lion with the latest office service pack installed. 14.3 I believe. The crash occurs in a For Each loop under some specific, but not uncommon, circumstances - user data type, sub-routine calls, data type declarations, etc. The VBA code is otherwise normal and, in fact, correct insofar as syntax and operation - it boils down to a subtle change which yields proper execution of macro or hard exception crash. I managed to recreate the problem in a minimalized, isolated, test case workbook. To whom should I send the test case? Before you send a test case would it be possible for us to test it?
![Qi macros for excel 2011 mac Qi macros for excel 2011 mac](/uploads/1/2/5/4/125486755/446356422.webp)
Besides a windows laptop, I also have a MACBook PRO and can test it for you? If yes, then you can upload the workbook in or in www.wikisend.com and share the link here? Sid (A good exercise for the Heart is to bend down and help another up) Please do not email me your questions.
I do not answer questions by email unless I get paid for it:) If you want, create a thread in Excel forum and email me the link and I will help you if I can. There appears to be a bug in the VBA compiler on Mac Excel 2011 with Variant datatypes. And it's fairly easily reproducible. In a nutshell, the following will cause a crash (data is corrupted on second iteration and, apparently, attempts to access a bad memory address) Dim testVar For Each testVar in someVariantArray Next testVar versus this version which works Dim testVar as Variant For Each testVar in someVariantArray Next testVar Both of the above execute fine on Windows Excel 2007. The 'fix' is to explicitly declare testVar as Variant.
But the underlying issue (I suspect in the VBA engine) may be a reason so many macros from Windows end up crashing on Mac OS X. Here is the workbook example Yeah, the short sample above omits the 'context' - was typing the reply last night but fell asleep!
Hehe It appears to be a confluence of several factors and not just the variable type declaration. Rather, it would seem it relates to having one or more of the following:. the variant array passed is in as an argument to a sub routine.
the variant array is contained in a user data type - although if use the #const to switch that off it still has problems. the testVar is declared local scope within an outer loop. etc. I figured once I got to the point it was consistently crashing, with what should be valid code syntax, i should send it over to Microsoft and let them look into it. I am getting the error even when I am declaring 'compName' as variant. At first I thought that since I am getting a series of errors so I rebooted but still got an error with 'compName' declared as variant. I have a feeling that declaring the 'compName' as variant or not is not the main issue.
It has to be something else. I am still checking it. Sid (A good exercise for the Heart is to bend down and help another up) Please do not email me your questions. I do not answer questions by email unless I get paid for it:) If you want, create a thread in Excel forum and email me the link and I will help you if I can.