Modify Active X settings using VBA?

isladogs

MVP / VIP
Local time
Today, 21:21
Joined
Jan 14, 2017
Messages
18,793
I rarely use Active X controls due to the issues they can cause.
However I recently made an exception in one of my databases to include the Microsoft Slider control v6.0.
I use this to change the zoom level on a downloaded map.

It has worked perfectly for a long time but a new client has disabled ActiveX controls in the trust centre & got error 2926

attachment.php


attachment.php


Any setting other than the first works fine with no error

In this case, I've advised the client to modify the settings.
However to avoid any future issues of this type wondered if anyone knows how to change ActiveX settings using VBA.
I'm sure it's a registry key setting but haven't found it so far

I know this goes against a primary development rule of not messing with your client's settings. If it can be done, I would note the setting on opening the app, modify it whilst the app is open, then restore the original setting on closing the app.

In the meantime, I've used error handling to deal with error 2926 by disabling the slider and informing the user if the error is triggered.

Any info on this appreciated.
 

Attachments

  • ActiveXError.PNG
    ActiveXError.PNG
    6.5 KB · Views: 574
  • ActiveXSettings.PNG
    ActiveXSettings.PNG
    18.2 KB · Views: 633
I'm sure it's a registry key setting but haven't found it so far
It's in the registry branch
Code:
HKEY_CURRENT_USER\Software\Microsoft\Office\Common\Security
There are two DWORD values in the above key.
DisableAllActiveX is just 0/1 and corresponds to the first option in your screenshot.
The other value, UFIControls, stores all the other settings shown in the screenshot. - You need to figure out yourself which value is which exactly,

But, please be aware, this is not just any setting on the users computer. It is a security setting and might expose the user's computer to risk. Unless you are in a corporate environment and have approval from IT, you should not mess with these settings without explicit user consent!
 
Thanks very much Phillip.
Hope all is well with you

A google search had failed to provide that info
Instead I'd been looking in places like this:
Code:
Computer\HKEY_CURRENT_USER\Software\Microsoft\Office\14.0\Access\Security

The setting would clearly affect all Office programs and as you say open up potential risks which as developer, I don't want to take the blame for.

For now, I'll stick with the work round I mentioned & see what transpires from other users

I'll think carefully before applying the registry hack and, if I do so, I'll definitely need to reset after use.

A better solution would be to use a non ActiveX slider control if such a thing exists. Any ideas?
 
...If it can be done, I would note the setting on opening the app, modify it whilst the app is open, then restore the original setting on closing the app...

I used the same approach, years ago, when changing some options, but in today's world of multi-tasking, you have to be very careful, especially when changing things that are system-wide, rather than limited to the given database.

...I've advised the client to modify the settings...
I think that this would be my approach, as well...explaining to him/her the reason for using the ActiveX/Slider Control. Who knows, perhaps he wouldn't need this feature.

Linq ;0)>
 
Thanks linq
I've just completed the attached information which is supplied as part of the program documentation.

Both your reply & Phillip's have confirmed this is a MUCH safer approach - let the client decide.

I'd be interested to know what settings would apply for users with a runtime version of Access
 

Attachments

Indeed much safer. Including the fact that

(a) in a really tight environment, you CANNOT change the security settings due to group policies that apply protections to certain branches of the registry hive, and

(b) in said tight environment, the ATTEMPT to modify the settings via a dialog or program would be logged as a security event. Found that out when working with the government.

In order to allow Access to manage its own references, it was necessary to send info up the management chain and point out that SOME registry settings are very necessarily changed by program. Had to also advise them of the branches in the hive that they needed to open up. It wasn't only Access that was affected. The Dept. of Defense policy wonks needed to be educated about what modern software does "on its own" that could be considered benign.

But then again, when wifey got a Win10 system to replace her beat-up old XP, I learned very quickly about turning off Cortana at the deepest levels possible. And the worst parts of THAT nightmare are that

(a) you cannot uninstall her, and

(b) patching has a chance of turning her back on despite your settings.

Don't you just LOVE Microsoft's S/W engineering department?
 
Doc,

Off topic - but if you have a "working list" of settings that ensure minimal invasion by Cortana, I'd like to see and use it.
In fact, a list to minimize exposure to anything. I agree S/W engineering is becoming --let's do it and let unsuspecting/less knowledgeable (than M$oft ) users try to figure it out. It's quite similar to a maze.
 
Hi Doc

Actually I do various registry and other settings changes using scripts as part of the installation EXE file. These include

1. I always set the locations of the installed folders to be trusted in the registry.
2. I set those same folders to have full read/write access as needed.
3. For apps using online maps in a web browser control, I apply the registry fix so the map renders correctly using IE11 mode
4. Program and licence info are also added to the registry.

For registry changes, I use the HKCU hive and it's never yet failed.
Conversely attempted changes to HKLM usually are blocked so it's not worth trying

Your comments about Cortana echo my experience with my PDF reader software being repeatedly overwritten by the Edge browser every time there is a Windows update. After it happened about a dozen times, I gave up and accepted it
 
my PDF reader software being repeatedly overwritten by the Edge browser every time there is a Windows update.

Also every time wifey has an exception in Firefox, Edge becomes the default browser. I've seen online in other venues that it happens with Chrome and Opera as well.

jdraw - I'd have to look up what I did, but there are articles online you could find by searching for "Disable Cortana." As I recall, I simply followed a couple of those articles to first remove it from the desktop completely and then from the start menu. I recall that there are some registry settings specific to Cortana that you can set to disable that beast. However, after some updates she will come back. And, as was the case in the furor years ago about IE being threaded into the OS, so is Cortana because she is tied deeply into the messaging subsystem. So no de-install.
 
For myself, I'm waiting for some bright person at MS to realize they could charge double for a version of the OS where all of these fun pieces are OPTIONAL. Say 500 euro for the "Standard" version, 1000 euro for the version where you can skip installing Cortana.

They would probably find users paying extra for more control of their computers even when they have to accept they can render their own machines unusable without reinstalling the OS.
 
10-4 guys----I've seen some mention of Spybot anti-Beacon on youtube so there may be some ideas to curtail "sending messages to the mothership" to be found there.
 

Users who are viewing this thread

Back
Top Bottom