Disable VBA via GPO disables Excel Add-in

Add-in Express™ Support Service
That's what is more important than anything else

Disable VBA via GPO disables Excel Add-in
 
Henjo van Rees




Posts: 46
Joined: 2018-12-10
We have our Excel Add-in installed and functioning correctly on a Citrix environment, for all users.

Due to a security audit on this environment, we want to disable VBA via the following group policy:
"Disable VBA for Office applications Enabled = Enabled"

Unfortunately this disables the Excel Add-in component (not the COM Add-in component).

Is this expected? Can anything be done to prevent it?

Our functions can be used in VBA, but our users do not use VBA.
Posted 18 Mar, 2021 01:45:00 Top
Andrei Smolin


Add-in Express team


Posts: 18823
Joined: 2006-05-11
Hello Henjo,

I don't know.

I have an impression that Excel add-ins can be allowed/disallowed by checking/clearing this checkbox:
- File | Options | Trust Center | Trust Center Settings | File Block Settings | Excel Add-in Files.

Also, does this disable Excel Automation add-ins, XLL add-ins or both?


Andrei Smolin
Add-in Express Team Leader
Posted 18 Mar, 2021 10:12:19 Top
Henjo van Rees




Posts: 46
Joined: 2018-12-10
I always mix up which one is which, but the COM Add-in is registered fine and works (the ribbon shows), but no functions are available.

So I think that only the XLL add-in is disabled.

I will check if changing the Trust Settings work.
Posted 18 Mar, 2021 10:26:21 Top
Andrei Smolin


Add-in Express team


Posts: 18823
Joined: 2006-05-11
An XLL add-in resides in the ADXXLLModule; check modules in your project.


Andrei Smolin
Add-in Express Team Leader
Posted 18 Mar, 2021 10:37:09 Top
Henjo van Rees




Posts: 46
Joined: 2018-12-10
When I disable VBA on my local machine, using the registry key that Microsoft documents here:
https://docs.microsoft.com/en-us/previous-versions/office/troubleshoot/office-developer/turn-off-visual-basic-for-application

HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Office\16.0\Common\
VBAOFF DWORD value to 1

(Create the key Microsoft\Office\<version>\Common if it does not exist)

At that point we see the following:
- Go to Excel Options > Add-ins > view Active Application Add-ins
- The Automation module (COM Add-in) is shown correctly and our ribbon element shows
- The XLL module (Excel Add-in) does not show the assembly name "OURAPP", but shows "Adxloader64.Ourapp" and does not function (our functions are not available)

This is unexpected since Microsoft also says:
https://support.microsoft.com/en-us/topic/considerations-for-disabling-vba-in-office-93a97e20-b60a-3d5d-886a-5983db31823c
"When VBA is disabled, you can still use add-ins that are compiled, such as Excel .xll add-in files, Word .wll add-in files, and Automation Add-ins"

Any ideas what is wrong? We are using a DLL instead of an .XLL file.
Can you reproduce the problem by setting the registry key VBAOFF=1 ?
Posted 25 Mar, 2021 02:23:38 Top
Andrei Smolin


Add-in Express team


Posts: 18823
Joined: 2006-05-11
Hello Henjo,

I reproduce this issue. I've found out that adxloader.log isn't created when Excel starts and VBAOFF is 1. This means Excel doesn't even try to load adxloader.{my addin name}.dll. Since that DLL is a native-code XLL, it looks like that information is incorrect.


Andrei Smolin
Add-in Express Team Leader
Posted 25 Mar, 2021 05:06:19 Top
Henjo van Rees




Posts: 46
Joined: 2018-12-10
Thanks for confirming. Do you have any clues why Excel isn't loading the adxloader.dll?

Do you know if there a difference between an XLL file and a DLL?
Posted 25 Mar, 2021 05:12:04 Top
Andrei Smolin


Add-in Express team


Posts: 18823
Joined: 2006-05-11
Henjo van Rees writes:

Do you have any clues why Excel isn't loading the adxloader.dll?


No. I only see the result - there's no attempt to load it.

From https://docs.microsoft.com/en-us/office/client-developer/excel/creating-xlls page. An XLL is a DLL that exports several procedures that are called by Excel or the Excel Add-in Manager.



Andrei Smolin
Add-in Express Team Leader
Posted 25 Mar, 2021 05:23:56 Top
Henjo van Rees




Posts: 46
Joined: 2018-12-10
Ok. So what we see is that when VBA is disabled, the ADX XLL is not loaded.
That leaves 2 possibilities:
1. The documentation from Microsoft is incorrect
2. The ADX XLL is seen/marked as a module which does something with VBA

I have my doubts that the Microsoft documentation is incorrect, because it does not seem logical to block XLL's when VBA is blocked. Are you certain that the ADX XLL is "built correctly" (not sure how to put it).

Due to security scans and audits we have many clients who must disable VBA to pass security audits, but then they cannot use our Excel Add-in anymore.

In my opinion ADX should work with VBA disabled. I hope you can help with this issue.
Posted 25 Mar, 2021 06:27:01 Top
Andrei Smolin


Add-in Express team


Posts: 18823
Joined: 2006-05-11
Hello Henjo,

Henjo van Rees writes:
Are you certain that the ADX XLL is "built correctly" (not sure how to put it)


The question is incorrect. It would be correct in this scenario: Excel loads the XLL add-in which doesn't work after that.

But the scenario is different: Excel doesn't even try to load the add-in. Should Excel try to load it, we would get the log file created/updated.

You could put the question differently: Is there something in the XLL add-in registration that prevents it from loading?

I don't know. But this is hardly so since registering an XLL add-in creates a single registry value, a string containing the loader file path and name. This works correctly if VBA is on.

Here's the value for an Automation add-in (see value Option{n} in Computer\HKEY_CURRENT_USER\SOFTWARE\Microsoft\Office\16.0\Excel\Options; n can be empty or 1,2,3,...):
/A "MyAddin18.ExcelAddinModule1"

An XLL add-in is loaded if there's this value (and VBA is on):

/R "E:\_Projects\_tests\_Andrei Smolin\MyAddin18\MyAddin18\bin\Debug\adxloader.MyAddin18.dll"

Finally, I've tried to load Analysis Toolpak. Although I suspect it isn't a pure XLL add-in - it shows behavior that XLL add-ins don't usually have - it shows as loaded in the Excel add-ins dialog but it doesn't add the Data Analysis button to the Data tab if VBA is off. Note that the Toolpak VBA add-in doesn't load but his is expected. It appears the Solver Excel add-in uses some VBA and it doesn't load for the same reason.

An ideal test would be to check whether a pure XLL works.


Andrei Smolin
Add-in Express Team Leader
Posted 25 Mar, 2021 08:02:43 Top