Use vba to disable "show add-in user interface"

AlexRigholt

Registered User.
Local time
Today, 05:43
Joined
Nov 14, 2008
Messages
36
Hi,

I finally managed to get the ribbon's File menu to work by removing all of Microsoft's options and adding my own. I just found out that I have to turn off the setting "show add-in user interface" for all of my 300+ users, to avoid a "Custom UI Runtime Error". This error gets triggered by these lines in the <Backstage> section of USyRibbons:

<button idMso="FileCloseDatabase" visible="false"/>
<button idMso="SaveObjectAs" visible="false"/>
<button idMso="FileSaveAsCurrentFileFormat" visible="false"/>
<button idMso="FileOpen" visible="false"/>
<button idMso="FileSave" visible="false"/>
<tab idMso="TabInfo" visible="false"/>
<tab idMso="TabRecent" visible="false"/>
<tab idMso="TabNew" visible="false"/>
<tab idMso="TabShare" visible="false"/>
<tab idMso="TabHelp" visible="false"/>
<tab idMso="TabRecent" visible="false"/>
<tab idMso="TabOfficeFeedback" visible="false"/>
<tab idMso="TabOfficeStart" visible="false"/>

My Question: Is there a way to change this setting through VBA?
 
Hi. Maybe try either SetOption or CurrentDb.Properties.

Sent from phone...
 
Hi. Maybe try either SetOption or CurrentDb.Properties.

Thanks!
Application.SetOption "show add-in user interface", False returns 'invalid name'
CurrentDb.Properties. <- what to write here?
 
Thanks!
Application.SetOption "show add-in user interface", False returns 'invalid name'
CurrentDb.Properties. <- what to write here?
Can't remember if I have it listed here, but you can take a look. I'll check again later.

 
Application.SetOption "Show Add-In User Interface Errors", False returned an 'invalid name' error.

The list of DBguy deals with the Current Database tab, while the option I'm looking for is in the Client Settings tab. However, in his May 2018 blog (https://thedbguy.blogspot.com/2018/05/) DBguy describes exactly my problem and a possible solution. I'll have a look at his page http://www.accessmvp.com/thedbguy/demos/hideoptions.php as well.
It seems I'll have to make an extra record for versions 2013 and 2016 in the USysRibbons table, and probably one for 2019 also, because that added TabOfficeFeedback and TabOfficeStart. At startup, I will check the Access version and load the corresponding ribbon.

So thanks DBguy! I've bookmarked your blog and website.
SOLVED.
 
Last edited:
in Access 2010:
Options > Client Settings > General > Show add-in user interface errors
 
@AlexRigholt
See https://social.msdn.microsoft.com/F...tion-show-addin-user-interface-errors-via-vba
It seems you cannot do so using vba.
It can be controlled by a registry setting but that would need to be done on all 300+ workstations

I've never found the need to do this with any of my ribbon customisations.
What specifically is triggering the error(s)
Perhaps you need to modify your custom ribbon to prevent these...or remove the ribbon completely

EDIT
Re-reading this thread, it seems the Feedback tab is your issue.
Personally I would suggest you just ignore that as users can't cause any problems with it available...or as already suggested remove the ribbon completely.
For info you can significantly shorten your USysRibbons xml and achieve the same result.
See this thread https://www.access-programmers.co.uk/forums/threads/ribbons-and-getting-rid-of-the-file-tab.303592.
In particular look at my code and example apps in posts #10 & #18
 
Last edited:
Thanks Isladogs, so vba cannot change that setting.
Remove the ribbon completely - I invested too much time in it to throw it away, and my users like it.

This morning I checked 5 computers and found that by default that box is unticked, so the problem may be much smaller than I thought it was. I had read the thread 'ribbons-and-getting-rid' a while ago and had used some of its suggestions.

For now I will work on the ribbons for 2010, 2013/2016 and 2019.
 
Thanks Isladogs, so vba cannot change that setting.
Remove the ribbon completely - I invested too much time in it to throw it away, and my users like it.

This morning I checked 5 computers and found that by default that box is unticked, so the problem may be much smaller than I thought it was. I had read the thread 'ribbons-and-getting-rid' a while ago and had used some of its suggestions.

For now I will work on the ribbons for 2010, 2013/2016 and 2019.

I can understand why you don't want to lose your custom ribbon but I've also found my users are happy with all functionality being provided by the form(s).
As you say the show addin user interface errors is off by default. So its highly unlikely that any will have it ticked.
As previously stated, I would suggest you just ignore the Feedback item. What harm can it do?

For info, several of my schools apps also have 300+ users. Users have different versions of Access from 2010 through to 365 and also different versions of Windows. An increasing proportion have 64-bit Access though the majority are still using 32-bit (for now). In addition, users have different size monitors, different resolutions and form factors. All of those combinations have to be allowed for...oh what fun!
BUT I've never had to worry about the setting that concerns you
 
ps, @silversun,

adding on to Colin's excellent points ... and the reason the door didn't get opened to changing more client settings might be perhaps because the current database shouldn't dictate anything other than its own properties?

Client properties are like the dashboard of a car -- the radio station or music that you like to listen to, the temperature, and other things controlled by you ... user comfort. By default, the ability to see these errors is off. Only those who go mucking about and changing things willy nilly without understanding the impact are at risk for not understanding the message when it finally appears. Explore! ... but also document what you change, and if you don't like the effects, or can't figure out what happened,, then change the setting back to the default.

Many options can be seen and set for the CurrentDatabase using VBA. Here are property names that you can use to get (GetOption) and set (SetOption) current database properties,

image showing Current database property names


... a caveat however ... just because you can do something doesn't mean you should ...

this goes into more detail about properties:

VBA > Properties > Get and set ... read, write, show, delete
http://msaccessgurus.com/VBA/Code/Properties.htm
 
Last edited:
pps, @silversun

and one more note ... these are a few client settings you CAN change with a macro or VBA -- and many forgot to set things back to the way they were! So maybe reluctance on the part of the Access team to easily allow it.

Access Options_Client Settings_Confirm_change with macro or VBA.png


... confusion after you open an application developed by a novice that turned these things off but didn't turn them back on -- and properties persist! When turned off, all of a sudden, you don't get confirmation to run an action query, or a message box when done with how many records got changed or deleted.
 
Last edited:
@isladogs, same here with Access 2010-365, 32/64 bit, Win7/Win10, Cel 2GB/i7 16GB. An additional challenge is the frequent updates with new reports and uploads to portals - mine is a payroll app. Can I see a demo of your school app?
 
Sure. Click on my website link, go to the School Data Analyser page and download the DEMO.
However be warned its a huge demo of about 1GB after unzipping as it comes with a complete set of data for a fictitious school.
The DEMO version data isn't for the current academic year
If you do download it, I suggest you ask any questions via email or PM
 

Users who are viewing this thread

Back
Top Bottom