Can't load Visual Basic for Applications

Anonymous
2012-08-25T16:50:15+00:00

I've read all the other threads on this subject, and none of them report problems that are exactly like what I'm experiencing. I'm hoping to avoid a complete remove/reinstall of Office 2011 for Mac. but we'll see.

The problem started yesterday when I tried to open Outlook and got a prompt telling me to upgrade or enter my product key. I entered the product key and it was "invalid". I used custom installation to reinstall Outlook only and nothing else from the original DVD. The installer reported "Installation successful", but Outlook still wouldn't accept the product key. Then I learned why: Outlook isn't part of the Home Student Edition, even though the installer installs the application. OK...so I need to buy an upgrade. I'll do that later. I only needed to check the way Outlook displays some HTML in an email.

The problem is that now none of my Excel macros work. When I try to open VBA, Excel displays a prompt that says, "Can't load Visual Basic for Applications - Visual Basic for Applications is not installed on this machine." Doesn't seem likely that VBA is missing, but I went ahead and used the DVD to do a custom reinstall of VBA only, and then rebooted my Mac. No good; I'm still getting the "Can't load Visual Basic for Applications" error.

Something is hammered in Excel 2011. I can save and close documents, but when I try to quit Excel, the app displays a prompt that says the following:

The file could not be accessed.

Try one of the following:

  • Make sure the specified folder exists.
  • Make sure the folder that contains the file is not read-only.
  • Make sure the file name does not contain any of the following characters: [ ] or :
  • Make sure the file/path name doesn't contain more than 218 characters.

Huh? No documents are open when that prompt appears; I'm just trying to quit the application. It was such a pain to set up my custom toolbars (Doom upon the ribbon!) in Office 2011 that I'd prefer not to start from scratch, but it's beginning to look like that's the only way. Any help would be greatly appreciated.

Microsoft 365 and Office | Excel | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments
{count} votes
Answer accepted by question author
  1. Anonymous
    2012-09-02T14:41:56+00:00

    Hi Jim:

    You wrote:

    "Thanks for sticking through this whole process...Advising to start with a complete remove and install would have saved you time, but seemed like overkill at first."

    I agree. The same is true of my efforts to figure out how to save the "Excel toolbars" file, which turns out to be non-existent in Excel 2011. I knew up front that the effort to save time might actually cost more time than just doing the remove and reinstall would have taken had I done it in the first place. But you don't know what you don't know until you know it, and hindsight is often clearer than foresight.

    But going through the process itself has value. Part of that value is learning something about the structure of the application's various directories and components. It's always a good idea to have a better working knowledge of one's tools. That becomes increasingly important as the software changes, especially when those changes don't always end up making the tools easier to use.

    Thanks again for your help.

    0 comments No comments
Answer accepted by question author
  1. Anonymous
    2012-09-02T00:44:29+00:00

    OK...I've removed and reinstalled Office 2011 and all relevant updates.

    To restore my toolbars, I simply opened a file to which I had attached all the toolbars in the previous (broken) installation of Office 2011, and...ZAH! -- all the toolbars reappeared.

    So, there's no question that Excel is saving the toolbars in the individual files, as long as they've been attached to the files using the Attach feature in the Customize Toolbars and Menus dialog.

    But Excel is also remembering the toolbar configuration that was in effect from the last file that was open before quitting the application. If I just open the application (but not a file), Excel opens a blank new workbook and remembers the last toolbar configuration I used. If I close one of the toolbars and then open a file to which it was attached (and in which the toolbar was open the last time I used the file), Excel doesn't automatically open that toolbar, even though it was displayed the last time I used that tile. Nevertheless, that toolbar is still listed in the View:Toolbars menu, so it's still available. But there's no "Excel Toolbars" file anywhere, as there was in Excel 2004.

    Alas, the toolbars in Word 2011 were gone when I reopened the newly installed Word. I had taken a screen shot of my toolbars before I removed/reinstalled Office, so it wasn't that big a pain to rebuild them from scratch using the screen shot as a guide. But I sure wish Microsoft still used explicit toolbar configuration files for Word and Excel. That would make doing a reinstall a whole lot easier.

    Oh...and VBA is working fine now. It seems pretty clear that something in the application was corrupted, and reinstalling Office 2011 fixed it. But in case anyone didn't read the earlier posts in this thread, just reinstalling the VBA component from the Office:Mac 2011 installation DVD did not fix it. It was necessary to completely remove and reinstall Office to solve the VBA problem, which is the primary subject of this thread.

    0 comments No comments

8 additional answers

Sort by: Most helpful
  1. Jim G 134K Reputation points MVP Volunteer Moderator
    2012-08-25T19:20:43+00:00

    Get out your install disc. Do another custom install. This time choose just he Visual Basic for Applications components. Install any updates if prompted.

    0 comments No comments
  2. Anonymous
    2012-08-25T19:51:06+00:00

    ...I went ahead and used the DVD to do a custom reinstall of VBA only, and then rebooted my Mac. No good; I'm still getting the "Can't load Visual Basic for Applications" error.

    As stated in my original post, I've already tried to do a custom reinstall of VBA only, and it didn't work. The installer app reported that the installation was successful, but apparently VBA doesn't know that. It still won't open, and the error message still insists that "Visual Basic for Applications is not installed on this machine."

    In Excel 2004 there was a separate file for the toolbars in the ~/Library/Preferences/Microsoft/ directory. It was possible to save that file elsewhere and restore it to that location after a remove/reinstall. The filename was "Excel Toolbars (11)", helpfully providing the app's version number in parentheses.  Apparently, the directory structure of the entire Office suite has changed. It appears that everything has moved to the ~/Library/Application Support/Microsoft/ directory, but I can find no equivalent of the Excel Toolbars (11) file for Excel 2011. Ditto for MS Word.

    If I could save my toolbars, I would just go ahead and remove Office 2001 and start from scratch again. It looks like I might have to do that anyway.

    0 comments No comments
  3. Jim G 134K Reputation points MVP Volunteer Moderator
    2012-08-29T17:32:29+00:00

    Hi again,

    There seems to be 2 things going on: The VBA problem, and the toolbar problem.

    If you luck out, you might solve both by following your hunch about the preferences files. In Lion and Moutain Lion the Library preferences folder is hidden. Open the Terminal application and enter:

    chflags nohidden ~/Library

    Then press return

    Quit Terminal App

    Now you will be able to go to:

    Username:Library:Preferences:Microsoft:Office 2011:Microsoft Excel Toolbars.plist

    If working with the preference file doesn't do the trick, then follow your second approach. Completely remove Office 2011 and then reinstall it

    http://support.microsoft.com/kb/2398768

    0 comments No comments