Go Back   Access World Forums > Microsoft Access Discussion > Modules & VBA

 
Reply
 
Thread Tools Rate Thread Display Modes
Old 02-13-2019, 10:45 PM   #1
Micron
Newly Registered User
 
Join Date: Oct 2018
Location: Ontario, Canada
Posts: 732
Thanks: 3
Thanked 150 Times in 144 Posts
Micron will become famous soon enough Micron will become famous soon enough
This Customization Was Already Loaded

Apologies for the long post. Either that or likely I'll have to say I tried most of what you're going to suggest. The issue is error message 32610: "DatabaseName.accdb cannot load customization 'Main'. This customization was already loaded."

Up to now, I've avoided customizing ribbons like the plague and have spent all day on it trying to learn. As per https://docs.microsoft.com/en-us/off...tarting-access
- I have table USysRibbons with RibbonName, RibbonXML (added ID PK, auto number) later as described elsewhere with xml for Main, Main2, Main3.

- Also incorporated Application.LoadCustomUI as per
https://docs.microsoft.com/en-us/off...n.LoadCustomUI

- I have Options>Client Settings>General "show add-in user interface errors" selected (that one seemed to point out all the errors in most db examples I downloaded about modifying ribbons). If not selected, same error.
- using <customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui"> with Access 2016
- doesn't matter if I select a ribbon in Options or not
- doesn't matter if full or shortcut menus allowed (with or without spec'ing a ribbon)
- As long as I call Application.LoadCustomUI strRibbonName, strXml (strXml = "Main") & pass the xml as a lookup, I get the error. Values are not null
- If I pass "Main2" to function, message is about Main2; doesn't matter if a menu is spec'd in Options or not.

AFAIK, the reason for calling LoadCustonUI is to load all ribbons so that they're available for any form/report, but I can't get it to work trying to load just one.

That's all I can think of. The only thing that I seem to have accomplished is to have only Exit on File tab. I have searched all day long (thus have even looked at old posts here) and I'm not the only one who's ever asked about this. Problem is, no threads arrived at a solution anywhere. Nothing I've read indicates that ALL ribbons are loaded just because they're in a table, but is that the case? Anybody got the magic answer for the error message?
Thanks in advance.

__________________
Sometimes I just roll my eyes out loud...
Windows 10; Office 365 (Access 2016)
Micron is offline   Reply With Quote
Old 02-13-2019, 11:53 PM   #2
isladogs
Part time moderator
 
isladogs's Avatar
 
Join Date: Jan 2017
Location: Somerset, UK
Posts: 9,448
Thanks: 106
Thanked 2,535 Times in 2,328 Posts
isladogs is a name known to all isladogs is a name known to all isladogs is a name known to all isladogs is a name known to all isladogs is a name known to all isladogs is a name known to all
Re: This Customization Was Already Loaded

Hi micron
I suspect that the various custom ribbons are contradicting each other or another standard ribbon.
Can you post a database with your Access option settings and USysRibbons table
__________________
If this answer has helped, please click the Thanks button and/or click the 'reputation scales' symbol on the left.

Website links:
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


Colin
Access 2010 32-bit, Access 2016 32-bit & 64-bit, SQL Server Express 2014, Windows 10,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
isladogs is offline   Reply With Quote
Old 02-14-2019, 08:12 AM   #3
Micron
Newly Registered User
 
Join Date: Oct 2018
Location: Ontario, Canada
Posts: 732
Thanks: 3
Thanked 150 Times in 144 Posts
Micron will become famous soon enough Micron will become famous soon enough
Re: This Customization Was Already Loaded

renamed autoexec so no need to bypass. Just run the macro when ready to see error message. I left Stops in the code so no need to worry about setting breakpoints.
Thanks to anyone who looks.
Attached Files
File Type: accdb AWFversion1.accdb (484.0 KB, 8 views)

__________________
Sometimes I just roll my eyes out loud...
Windows 10; Office 365 (Access 2016)
Micron is offline   Reply With Quote
Old 02-14-2019, 10:56 AM   #4
isladogs
Part time moderator
 
isladogs's Avatar
 
Join Date: Jan 2017
Location: Somerset, UK
Posts: 9,448
Thanks: 106
Thanked 2,535 Times in 2,328 Posts
isladogs is a name known to all isladogs is a name known to all isladogs is a name known to all isladogs is a name known to all isladogs is a name known to all isladogs is a name known to all
Re: This Customization Was Already Loaded

Had a quick look at it. Didn't know you spoke Polish!

1. Using Office 2010, triggers an error in the line
<tab idMso="TabOfficeFeedback" visible="false"/>
I realise that's fine in Access 365

2. Although I've created my own ribbons, I'm by no means an expert and someone with better knowledge of ribbons may correct me on the following statement.
AFAIK you can only load one custom ribbon at a time. By that I mean one record from USysRibbons in use only.
However you can load more than ribbon within that record ...as you have done
So your Main ribbon runs fine on its own
However your startup code tries to load ribbon code Main2 triggering your error 32609
If you want Main2 or Main 3 or Main 4 then load that from Access Options.
If you want several at once you need to combine the code into one USysRibbons record

Hope that helps
__________________
If this answer has helped, please click the Thanks button and/or click the 'reputation scales' symbol on the left.

Website links:
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


Colin
Access 2010 32-bit, Access 2016 32-bit & 64-bit, SQL Server Express 2014, Windows 10,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
isladogs is offline   Reply With Quote
Old 02-14-2019, 12:57 PM   #5
ncwatt
Newly Registered User
 
Join Date: Feb 2019
Posts: 7
Thanks: 3
Thanked 2 Times in 2 Posts
ncwatt is on a distinguished road
Re: This Customization Was Already Loaded

If you open the form in design mode and on the properties screen go down to Ribbon Name, you will have a drop down with the 4 ribbons you have setup. I've only used Main and it works fine when you put the form in to Form View.

You don't load Ribbons on top of Ribbons. Your complete XML should mark out the full ribbon bar (tabs, groups, buttons etc.).

<ribbon startFromScratch="true"> Clears all the Microsoft ones. If you set this to false your ribbons would be loaded in addition to the default ones.
ncwatt is offline   Reply With Quote
The Following User Says Thank You to ncwatt For This Useful Post:
Micron (02-16-2019)
Old 02-14-2019, 01:46 PM   #6
isladogs
Part time moderator
 
isladogs's Avatar
 
Join Date: Jan 2017
Location: Somerset, UK
Posts: 9,448
Thanks: 106
Thanked 2,535 Times in 2,328 Posts
isladogs is a name known to all isladogs is a name known to all isladogs is a name known to all isladogs is a name known to all isladogs is a name known to all isladogs is a name known to all
Re: This Customization Was Already Loaded

Quote:
Originally Posted by ncwatt View Post
If you open the form in design mode and on the properties screen go down to Ribbon Name, you will have a drop down with the 4 ribbons you have setup. I've only used Main and it works fine when you put the form in to Form View.
Sorry but I've no idea what you are referring to here
Are you suggesting changing the ribbon in Access options which I was referring to...or something else?

Quote:
Originally Posted by ncwatt View Post
You don't load Ribbons on top of Ribbons. Your complete XML should mark out the full ribbon bar (tabs, groups, buttons etc.).
I believe that's the same point as I made
__________________
If this answer has helped, please click the Thanks button and/or click the 'reputation scales' symbol on the left.

Website links:
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


Colin
Access 2010 32-bit, Access 2016 32-bit & 64-bit, SQL Server Express 2014, Windows 10,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
isladogs is offline   Reply With Quote
Old 02-14-2019, 01:57 PM   #7
Micron
Newly Registered User
 
Join Date: Oct 2018
Location: Ontario, Canada
Posts: 732
Thanks: 3
Thanked 150 Times in 144 Posts
Micron will become famous soon enough Micron will become famous soon enough
Re: This Customization Was Already Loaded

Quote:
AFAIK you can only load one custom ribbon at a time. By that I mean one record from USysRibbons in use only.
If I posted the right links, one of them details that a) you put a ribbon name and xml for each ribbon in the table; and b) you create a recordset, loop it, and call the function for each record to load each ribbon. That implies you can load ribbons other than the one spec'd in options, or to load ribbons when there is no ribbon spec'd in options. Either way fails. So I don't understand your point about not only being able to load only one. The M$ article implies differently. The other ribbons would be for reports and forms, not that you would have several "main" ribbons. Perhaps that is what you're thinking? Then again, I did see a reply (from Albert Kallal?) that proposed having duplicates of a ribbon, minus options not intended for the casual user, and swapping them during normal use rather than trying to add/remove ribbon functionality. This also requires additional ribbons & xml records in your table.
Quote:
However your startup code tries to load ribbon code Main2 triggering your error 32609
Interesting - different number for you. Don't forget - same error results if code attempts to load Main2 if
a) no ribbon set in options;
b) Main set in options
c) any other ribbon set in options

Quote:
If you want Main2 or Main 3 or Main 4 then load that from Access Options.
Your mindset seems to be around loading one main ribbon, not one main and a bunch of secondary ones related to forms/reports. Maybe this method was deprecated, but the articles aren't that old.
Quote:
If you want several at once you need to combine the code into one USysRibbons record.
Not grasping that, unless you're referring to my prior comments about the article to loop a USysRibbons recordset. Don't forget, the trials I listed point out that the error occurs if you run the code even if there is no ribbon spec'd in options. That's the biggest puzzle about the whole thing. If there's no ribbon spec'd in options and you run the code, why would Access say the ribbon is already loaded when it's not spec'd in options? It behaves as if just having the table is doing the loading. At this point, I have no form to test with respect to allocating one of the secondary ribbons to it.

__________________
Sometimes I just roll my eyes out loud...
Windows 10; Office 365 (Access 2016)
Micron is offline   Reply With Quote
Old 02-14-2019, 02:11 PM   #8
Micron
Newly Registered User
 
Join Date: Oct 2018
Location: Ontario, Canada
Posts: 732
Thanks: 3
Thanked 150 Times in 144 Posts
Micron will become famous soon enough Micron will become famous soon enough
Re: This Customization Was Already Loaded

Quote:
Originally Posted by ncwatt View Post
If you open the form in design mode and on the properties screen go down to Ribbon Name, you will have a drop down with the 4 ribbons you have setup. I've only used Main and it works fine when you put the form in to Form View.
You don't load Ribbons on top of Ribbons. Your complete XML should mark out the full ribbon bar (tabs, groups, buttons etc.).
Appreciate the input. Please review my reply to Isladogs re the M$ articles. You also seem to be of the opinion that you don't load more than one ribbon, which as I point out above, the article says you do - assuming I haven't misinterpreted it. It might help if anyone can clear up why I get the impression that looping through a recordset of ribbon names to load is an acceptable approach that might help. When I read it, I presumed you're supposed to load the ones you'll be using so that they're available to the project on demand, such as when a form opens. I didn't try setting that property in my form yet as I only intended it to be for editing the xml. BTW, I do understand the scratch thing although this issue might suggest otherwise.

In the end, I'll probably just have the table, load the main and point forms/reports to the secondary ones. Just blows me away that following the article doesn't work and seems to be contrary to everyone else's thoughts.
__________________
Sometimes I just roll my eyes out loud...
Windows 10; Office 365 (Access 2016)
Micron is offline   Reply With Quote
Old 02-14-2019, 02:17 PM   #9
Micron
Newly Registered User
 
Join Date: Oct 2018
Location: Ontario, Canada
Posts: 732
Thanks: 3
Thanked 150 Times in 144 Posts
Micron will become famous soon enough Micron will become famous soon enough
Re: This Customization Was Already Loaded

There is a ribbon name option on Other tab of property sheet. There are menu and bar settings as well. I guess you pick a ribbon for the form.

Forgot to apologize to the author of that xml code. I grabbed it because it looked quite robust and thought it would be a good primer for learning. It was a comment like "I've never used that many customizations in a ribbon" that attracted me to it. Hope he doesn't mind.
__________________
Sometimes I just roll my eyes out loud...
Windows 10; Office 365 (Access 2016)
Micron is offline   Reply With Quote
Old 02-14-2019, 02:39 PM   #10
ncwatt
Newly Registered User
 
Join Date: Feb 2019
Posts: 7
Thanks: 3
Thanked 2 Times in 2 Posts
ncwatt is on a distinguished road
Re: This Customization Was Already Loaded

Went for a run and had a think about it.

Do you want one ribbon which is the main one (displayed across the whole app), and then have additional ribbons displaying more options depending on the form loaded?

Using your example DB you had "Main" as the ribbon for the whole database. I've then set "Main4" to also appear when you open the form "frmRibbons". When you close the form the options on "Main4" disappear leaving just "Main" again. Is this what you're trying to achieve?
Attached Files
File Type: accdb AWFversion1.accdb (472.0 KB, 6 views)
ncwatt is offline   Reply With Quote
Old 02-14-2019, 03:12 PM   #11
Micron
Newly Registered User
 
Join Date: Oct 2018
Location: Ontario, Canada
Posts: 732
Thanks: 3
Thanked 150 Times in 144 Posts
Micron will become famous soon enough Micron will become famous soon enough
Re: This Customization Was Already Loaded

Quote:
Originally Posted by ncwatt View Post
Do you want one ribbon which is the main one (displayed across the whole app), and then have additional ribbons displaying more options depending on the form loaded?

Using your example DB you had "Main" as the ribbon for the whole database. I've then set "Main4" to also appear when you open the form "frmRibbons". When you close the form the options on "Main4" disappear leaving just "Main" again. Is this what you're trying to achieve?
That's a good start. I think I'll have to take that approach and forget about the article. As mentioned in a prior post, when it comes to the "main" ribbon it was suggested that variations of main ribbons might be a better approach as opposed to trying to hide elements of it from unauthorized users. I suppose there's code for that, but I'm not there yet.

EDIT: Ok, I opened the db, checked that the File tab was as before (it was), added the Main2 to the form, checked it out & went to the file tab. Other additional options were there. OK, so maybe it affects that tab as well, likely due to the scratch option. I closed and reopened db and went to the File tab without opening the form and the options were different again, but not as original. Someone at M$ decided this is better and more stable than commandbars? Gimme a break.
__________________
Sometimes I just roll my eyes out loud...
Windows 10; Office 365 (Access 2016)

Last edited by Micron; 02-14-2019 at 03:35 PM.
Micron is offline   Reply With Quote
Old 02-14-2019, 03:42 PM   #12
isladogs
Part time moderator
 
isladogs's Avatar
 
Join Date: Jan 2017
Location: Somerset, UK
Posts: 9,448
Thanks: 106
Thanked 2,535 Times in 2,328 Posts
isladogs is a name known to all isladogs is a name known to all isladogs is a name known to all isladogs is a name known to all isladogs is a name known to all isladogs is a name known to all
Re: This Customization Was Already Loaded

The thread has moved on a lot since I last looked at it so this may now be out of date.

sorry - I haven't had time to read the links you provided

Quote:
Originally Posted by Micron View Post
Interesting - different number for you.


Quote:
Originally Posted by Micron View Post
Don't forget - same error results if code attempts to load Main2 if
a) no ribbon set in options;
b) Main set in options
c) any other ribbon set in options

Your mindset seems to be around loading one main ribbon, ....
I've never tried to load a second set of ribbon code using code or a macro.
In fact prior to this I'd never heard of anyone doing so ...but that may be ignorance on my part.

You already have 2 custom ribbons added to the Main ribbon. You can add more in the same way.
AFAIK ribbons can only be added at startup.

To change ribbons would require a restart as you can see if you change it in Access options

I would recommend looking at the tutorials/examples by Gunter Avenius on his RibbonCreator site
Attached Images
File Type: png Capture.PNG (3.3 KB, 69 views)
__________________
If this answer has helped, please click the Thanks button and/or click the 'reputation scales' symbol on the left.

Website links:
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


Colin
Access 2010 32-bit, Access 2016 32-bit & 64-bit, SQL Server Express 2014, Windows 10,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
isladogs is offline   Reply With Quote
Old 02-14-2019, 04:34 PM   #13
Micron
Newly Registered User
 
Join Date: Oct 2018
Location: Ontario, Canada
Posts: 732
Thanks: 3
Thanked 150 Times in 144 Posts
Micron will become famous soon enough Micron will become famous soon enough
Re: This Customization Was Already Loaded

Quote:
You already have 2 custom ribbons added to the Main ribbon
Hmm, so would one use <startFromScratch="false"> and just hide/show tabs instead of replacing the ribbon based on user levels?
Will go back there, but have seen that site.

Last edited by Micron; 02-14-2019 at 04:35 PM. Reason: added comment
Micron is offline   Reply With Quote
Old 02-14-2019, 04:50 PM   #14
isladogs
Part time moderator
 
isladogs's Avatar
 
Join Date: Jan 2017
Location: Somerset, UK
Posts: 9,448
Thanks: 106
Thanked 2,535 Times in 2,328 Posts
isladogs is a name known to all isladogs is a name known to all isladogs is a name known to all isladogs is a name known to all isladogs is a name known to all isladogs is a name known to all
Re: This Customization Was Already Loaded

TBH my approach is usually as follows:
a) standard user - no nav pane or ribbon (but print preview ribbon restored whilst reports are loaded then removed when the report is closed)
b) program admin user - nav pane & ribbon visible

I try to ensure all functionality is included within my apps so that the ribbon isn't needed. My custom ribbons are for items which aren't Access features e.g.



Other than switching on/off the print preview ribbon I don't recall any examples I have of ribbon variations during program use
Attached Images
File Type: png HelpRibbon.PNG (20.8 KB, 57 views)

__________________
If this answer has helped, please click the Thanks button and/or click the 'reputation scales' symbol on the left.

Website links:
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


Colin
Access 2010 32-bit, Access 2016 32-bit & 64-bit, SQL Server Express 2014, Windows 10,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
isladogs is offline   Reply With Quote
The Following User Says Thank You to isladogs For This Useful Post:
Micron (02-16-2019)
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Forms customization lpapad Forms 5 07-31-2018 03:22 AM
eBay customization NigelShaw Web Design and Development 0 05-10-2012 03:54 AM
Question Ribbon customization AliyuKatsina General 5 05-27-2010 04:22 AM
Customization fredalina Reports 5 01-16-2009 12:56 PM
Advanced Customization oihjk General 6 02-04-2008 04:28 PM




All times are GMT -8. The time now is 03:21 AM.


Microsoft Access Help
General
Tables
Queries
Forms
Reports
Macros
Modules & VBA
Theory & Practice
Access FAQs
Code Repository
Sample Databases
Video Tutorials

Featured Forum post


Sponsored Links


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World