Excel VBA can’t find project or library once I enable macros - excel

I’ve done a LOT of googling about this and haven’t found anything specific to this situation. Apologies if I missed it.
I have a .xlsm workbook that has a few macros—-one to refresh connections to a Microsoft Access Database, one to refresh pivots, and one to save it to multiple locations.
When I open the file, I get the standard yellow security bar that some active content has been disabled—-but it used to just say ‘macros have been disabled’. When I check the macros, they are there.
BUT when I hit ‘enable’, there’s 2 issues:
it doesn’t enable anything and I have to go to the Trust Center to enable both Macros and External Data Connections. Before yesterday, I never had to do that.
Once I enable macros and external data in the Trust Center, suddenly I get an alert that VBA “can’t find a project or library” and all my macros are now gone.
When I reload the workbook, we’re back to where I started. I have one other workbook with this issue. The other 5 or 6 macro-enabled workbooks do not have this issue.
The issue with these docs persists across 2 other colleagues’ remote laptops. However, when I remote into the office and access the same files in the same folder using VMWare to remote into an office PC environment, they work just fine.
I have tried accessing Tools>References in VBA—-nothing happens when I click ‘References’. I have restarted. I have emailed the files from the VMWare environment to myself, and they don’t work. I have enabled all macros and data connections by selecting those radio buttons, but still have VBA throwing that error and my macros disappearing until I reopen the file.
I truly don’t understand. Can somehow the files be corrupted only when I access them from home? Is there any fix?

Related

Cannot open xlsb workbooks with macros and custom ribbons

Suddenly we are unable to open xlsb Excel workbooks with Excel complaining "Excel cannot open the file because the file format or file extension is not valid." The files are on a network drive but the issue happens if they are copied to a cloud location. The error occurs when opening the files directly from our laptops but if we use a VM (virtual machine) the files open fine and work normally. The files are xlsb with macros and custom ribbons. However at least one is xlsm with no ribbon.
There were some security patches rolled out from Microsoft which I suspect have broken something. Anyone else have this issue? reminds of a very similar event about a decade ago.
It was caused by a change in internal security. The team were configuring Attack Surface Reduction rules for test/audit but they accidentally got enabled/enforced.

Excel Macro not showing as add-in

I have been working with this excel macro since April 23rd. Recently it has stopped showing up even though it is showing installed. Any ideas?
What I have already tried:
I have checked the trust center to add the folder I have the macro stored in but it is currently stored on an internal network drive that can not be added to the trust center.
I have also moved the macro to the default directory for Macros. It still will not load in.
When I just drag the macro .xla file into Excel it will pick it up and start showing in the VBA IDE, but only if the file I drag in is stored on the default directory.
Excel Macros installed:
Excel Options
Add-ins
Excel VBA IDE not showing the macros as well as not showing in the ribbon:
Add-ins tab not showing add-ins
Missing from VBA IDE
I am not certain if this applies to your case, but this is what worked for me with the following set up:
- Using Windows
- Add-in stored on the network drive
My problem was that after I installed an add-in it would show up (both IDE and as a custom ribbon), but after I closed Excel and reopened it the add-in would fail to load (no ribbon, no IDE).
First step to fix this is to add a trusted location in Excel settings:
Trust Center -> Trusted Locations
You may need to select [Allow Trusted Locations on my network] before adding a location.
You can add just one folder, or, if it is appropriate, you can even add the whole network drive.
You may want to select [Subfolders in this location are also trusted]
The second step was far from obvious to me. I also needed to add network folder as a trusted location in Internet Explorer of all things:
Settings -> Internet Options -> Security -> Intranet -> Sites -> Advanced
Then you need to add the folder path to the network folder that contains the add-in.
After completing both steps and reopening Excel add-ins in the network folder started to appear both in IDE and as a custom ribbon. These two steps were necessary part of installation for every user.
If you are using multiple add-ins you may want to consider using one network folder for them. You can also take a look at this question about network add-ins to see how they can be distributed in a more convenient fashion (one of the answers there is mine).

Excel VBA Userform won't work on all computers

I have made a user's form using VBA excel code. Its working fine on my laptop however when I tried it on my office computer it doesn't work. I emailed the file to myself and downloaded it from Outlook in the office. Its a .xlsm file. It gives me an error message that macros have been disabled. I have already changed settings to enable macros and allow VBA projects. I reopened excel and checked again it still doesn't work. The downloaded file from outlook, when I click visual basic, it doesn't show me any user form or code at all. Not sure why.
My whole code is present in the user form part (file in a personal laptop). There is a button on "sheet 3" which basically opens the user form. Not sure if it's saving the code only locally on my computer. As per my understanding if it's saved in the file it should be a part of it even if its opened on any other computer. My laptop version is office 365 and office one is 2016. I am not an advanced user. Kindly advise what is the error out here.

Unable to create Excel macros on particular machine (possible Windows Group Policy issue?)

I have a Windows 2003 Server box with Excel 2010 installed, upon which I am unable to create new or execute existing macros in spreadsheets. Note: this machine is in a Windows Domain (and I am not getting much help from the network folks here.)
I can and have edited the macro security levels within Excel (File, Options, Trust Center, Macro Settings --> Enable All Macros) but despite this, when I try to:
Open a spreadsheet with macros, I get an exception "Excel found unreadable content...." which goes on to refer to the VBA macros within the spreadsheet
Create a new macro in a brand new spreadsheet created on this machine, all the toolbar buttons providing access to the VBA editor are disabled.
Could this be a Group Policy setting that allows me to edit the macro security settings, but overrides these settings and prevents me from actually creating, editing, or executing VBA macros? (If so, does anyone happen to know which group policy setting I should be looking for?)
I've run rsop.msc (Resultant Set of Policy) on the machine and looked through every single thing under both Computer Configuration and User Configuration, but I don't see anything related to Excel (or Office) Security/Macros.
In this case, the problem was that Visual Basic for Applications hadn't been installed when Excel itself was installed.
(As usual, Microsoft could do a much better job of alerting the user to this unusual configuration, but what can you do.)

Excel VBA sharing addins between different read-only instances of same workbook

My team and I share this workbook on a network drive. This workbook utilizes a few custom add-ins necessary for some custom functionality. These add-ins get automatically installed by custom VBA code I have added without any action on the part of the user. It seems that only I can use the add-ins - other team members have problems trying to load the add-ins, they get this error:
Run-time error 1004 Unable to copy add-in to library.
The error occurs when trying to run
Application.AddIns.add(<addin_name>)
The add-ins are located only on the Windows network share. I've written the code to ignore the prompt for copying the add-in to addins folder on local drive, because I don't want this to happen. This is a very annoying problem because I cannot debug it fully myself, I need the cooperation of my team members which is limited. Help greatly appreciated, thanks.
I would suggest just opening the XLA read-only from the network drive as if it was a workbook (which of course it is) rather than using Addins.Add - opening an XLA makes it available to the Excel session so it will function as an addin without being in the addins collection.

Resources