I am developing some macros in VBA for Mac PowerPoint. I would like to add some keyboard shortcuts to some of them, but it looks like the Application.OnKey module is not present.
Am I missing something or it looks like this is not possible at all on Mac?
The object model in current versions of PowerPoint for Mac is quite poor. It seems like every project I try to port to it from Windows has some object missing. Today, I found that custom Ribbon modifications can't run VBA macros in PowerPoint for Mac, though the same file works in Windows and identical mods in Word and Excel work on both Windows and Mac. So I'm not surprised that you've discovered another missing object. Please report it to Microsoft using the smiley-face icon in the upper right.
I have a weird problem in Excel's Visual Basic Editor: it shows me a very thin textfield with only one character per line and no way to alter the dimensions.
Has anybody experienced a similar problem or is there a way to open macros in a text editor as a workaround?
System: Mac OS 10.11.1, Office 2016 v15.13.1, already tried reinstall.
According to this link by Visual Basic support in Office for Mac 2016 is almost non existent. So a workaround would be to install an earlier version for the use of macros.
Thanks to Meehow for pointing it out.
I experience the same issue.
You can copy all code, edit it in a text editor before pasting the content back into the VB Editor. It's ugly but it works.
Selecting all via Cmd+A works even if you can't visualise it.
I recently installed the spreadsheet link ex add-in on my excel 2013, but it doesn't work. When I try to choose the option 'Start MATLAB' from MATLAB field in HOME Ribbon it gives me an error:
'Cannot run the macro 'ribStartMatlab'. The Macro may not be available in this workbook or all macros all disabled.'
The same thing happens with any other MATLAB command chosen from excel.
I chose the option 'Enable all macros' in the Macro Security Settings and also checked the box 'Trust access to the VBA project object model'.
I also checked the SpreadsheetLink2007_2010 reference in the VBA->Tools->References (none other is available).
I found some information that the version of SP for Office might be put to blame but I checked and it seems I have the latest version of SP1 for Office 2013.
The exact name of the add-in is 'Spreadsheet Link EX 3.2 for use with MATLAB and Excel', the Office version is 2013 Proffesional Plus, and the MATLAB version is 2013b. Any help or tips greatly appreciated.
this is more of a guess than anything else. But I'm guessing the ribbon/macros use activeX control. at the end of last year there was an update to excel that disables activeX, which usually results in strange performance or code breaking with very cryptic error messages. It's a bit complicated to get it to work again, but here is a post that might provide some insight http://blogs.technet.com/b/the_microsoft_excel_support_team_blog/archive/2015/03/11/forms-controls-stop-working-after-december-2014-updates-.aspx
again, this is really a guess, I don't know for certain the matlab commands use activeX but it's worth looking into
I have a very simple Excel Addin build it in Visual Studio 2008 for Excel 2003, which creates a toolbar with some buttons.
When I debug it, with System Format set to "English (United States)" it works great, without problems.
However, this addin is going to be used with System Format set to "French (France)" too, and when I try to debug my addin under this configuration, the toolbar (which is created by the addin) is not being shown.
While I'm debugging I can see that the methods that create the toolbar are executed and the code returns fine, yet I can't see anything in Excel, and if I switch back the format to English it works again.
Does anyone know which could be the reason?
I had a similar problem with an add-in that I built for Excel 2000. Although the tool bar would show, nothing was on the toolbar. I was able to correct the issue by downloading the
office multilanguage pack 2003.
Here is a link to it, assuming you do not already have this installed it may be worth a shot.
http://office.microsoft.com/en-us/ork2003/HA011402201033.aspx
In the end, there was a problem related with the decimal separator, which changes for French language, and a validation that I was doing in my code, I missed that part when debugging, thanks for the answers anyway.
So I'm having to run someone else's excel app on my PC, and I'm getting "Can't find Project or Library" on standard functions such as date, format, hex, mid, etc.
Some research indicates that if I prefix these functions with "VBA." as in "VBA.Date" then it'll work fine.
Webpages suggest it has to do with my project references on my system, whereas they must be ok on the developer's system. I'm going to be dealing with this for some time from others, and will be distributing these applications to many others, so I need to understand what's wrong with my excel setup that I need to fix, or what needs to be changed in the xls file so that it'll run on a variety of systems. I'd like to avoid making everyone use "VBA." as an explicit reference, but if there's no ideal solution I suppose that's what we'll have to do.
How do I make "VBA." implicit in my project properties/references/etc?
-Adam
I have seen errors on standard functions if there was a reference to a totally different library missing.
In the VBA editor launch the Compile command from the menu and then check the References dialog to see if there is anything missing and if so try to add these libraries.
In general it seems to be good practice to compile the complete VBA code and then saving the document before distribution.
I had the same problem. This worked for me:
In VB go to Tools ยป References
Uncheck the library "Crystal Analysis Common Controls 1.0". Or any library.
Just leave these 5 references:
Visual Basic For Applications (This is the library that defines the VBA language.)
Microsoft Excel Object Library (This defines all of the elements of Excel.)
OLE Automation (This specifies the types for linking and embedding documents and for automation of other applications and the "plumbing" of the COM system that Excel uses to communicate with the outside world.)
Microsoft Office (This defines things that are common to all Office programs such as Command Bars and Command Bar controls.)
Microsoft Forms 2.0 This is required if you are using a User Form. This library defines things like the user form and the controls that you can place on a form.
Then Save.
I have experienced this exact problem and found, on the users machine, one of the libraries I depended on was marked as "MISSING" in the references dialog. In that case it was some office font library that was available in my version of Office 2007, but not on the client desktop.
The error you get is a complete red herring (as pointed out by divo).
Fortunately I wasn't using anything from the library, so I was able to remove it from the XLA references entirely. I guess, an extension of divo' suggested best practice would be for testing to check the XLA on all the target Office versions (not a bad idea in any case).
In my case, it was that the function was AMBIGUOUS as it was defined in the VBA library (present in my references), and also in the Microsoft Office Object Library (also present). I removed the Microsoft Office Object Library, and voila! No need to use the VBA. prefix.
In my case, I could not even open "References" in the Visual Basic window. I even tried reinstalling Office 365 and that didn't work. Finally, I tried disabling macros in the "Trust Center" settings. When I restarted Excel, I got the warning message that macros were disabled, and when I clicked on "enable" I no longer got the error message.
Later I re-enabled all macros in the "Trust Center" settings, and the error message didn't show up!
Hey, if nothing else works for you, try the above; it worked for me! :)
Update:
The issue returned, and this is how I "fixed" it the second time:
I opened my workbook in Excel online (Office 365, in the browser, which doesn't support macros anyway), saved it with a new file name (still using .xlsm file extension), and reopened in the desktop software. It worked.
Even when all references are fine the prefix problem causes compile errors.
What about creating a find and replace sub for all 'built-in VBA functions' in all modules,
like this:
replace text in code module
e.g. "= Date" will be replaced with "= VBA.Date".
e.g. " Date(" will be replaced with " VBA.Date(" .
(excluding "dim t As Date" or "mydate")
All vba functions for find and replace are written here :
vba functions list
For those of you who haven't found any of the other answers work for you.
Try this:
Close out of the file, email it to yourself or if you're at work, paste it from the network drive to your desktop, anything to get it to open in "protected mode".
Now open the file
DON'T CLICK ANY ENABLE EDITING OR THE YELLOW RIBBON
Go to the VBA Editor
Go to Debug - - Compile VBA Project, if "Compile VBA Project" is greyed out, then you may need to click the yellow ribbon one time to enable the content, but DO NOT enable macros.
After you click Compile, save, close out of the file. Reopen it, enable everything and it should be OK. This has worked for me 100% of the time.
In my case I was checking work done on my office computer (with Visio installed) at home (no Visio). Even though VBA appeared to be getting hung up on simple default functions, the problem was that I had references to the Visio libraries still active.
I found references to an AVAYA/CMS programme file? Totally random, this was in MS Access, nothing to do with AVAYA. I do have AVAYA on my PC, and others don't, so this explains why it worked on my machine and not others - but not how Access got linked to AVAYA. Anyway - I just unchecked the reference and that seems to have fixed the problem
I've had this error on and off for around two years in a several XLSM files (which is most annoying as when it occurs there is nothing wrong with the file! - I suspect orphaned Excel processes are part of the problem)
The most efficient solution I had found has been to use Python with oletools
https://github.com/decalage2/oletools/wiki/Install and extract the VBA code all the modules and save in a text file.
Then I simply rename the file to zip file (backup just in case!), open up this zip file and delete the xl/vbaProject.bin file. Rename back to XLSX and should be good to go.
Copy in the saved VBA code (which will need cleaning of line breaks, comments and other stuff. Will also need to add in missing libraries.
This has saved me when other methods haven't.
YMMV.