Execute/Create Ribbon through vba Code

mAP3d

New Member
Joined
Sep 30, 2015
Messages
12
hi guys,

I am currently optimizing a project system which has about 300 controls, divided in 9 groups (every group has about 5-20 sub menus), currently stored in the 'Add-Ins' tab. Because of usability, I used the custom ui editor in the last days to put this hierarchy into a ribbon bar, which is placed before the Home Tab, and gets loaded when anyone opens the .xlsm file (I call it 'parent-file' in this post). everything works quite fine, the controls are dynamic and users are able to change the language in the menu, when they do, the labels invalidate and get their translated pendant.

now I am on the next stage of this project, as there are certain .doc or .ppt files, which get executed/requested/edited from time to time, and till now, have their 'Add-Ins' controls to do certain things. My question is now: Is it possible to create a ribbon which has like the same characteristics as the one I already created? it should open, as someone executes the .doc/.ppt/..., and close again, when the file is closed (through the vba-procedure, of course). as u could imagine, I am searching the web for something since 3 days. I guess I almost found any possible solution, also tried a lot, but every way got his own issues imo.

to sum this up: First of all: I already know the CUSTOM UI EDITOR! pls do not tell me that it is way easier to edit the ribbon through this neat little program, as it is not practical for the problem I am facing
opening the .xlsm file as a zip and editing the customui14 file with editor i.e., is also no option, same reasons as above.

I would highly appreciate it, if there was anyone who could give me a glimpse, if it is over-all worth it, or if I would be better advised in staying with the Add-Ins controls.

this is kind of my last address to get possible information from, since the msdn post (https://social.msdn.microsoft.com/F...te-ribbon-bar-through-vba-code?forum=exceldev), I started a few days ago, seems to be dead.
my last option would be the book "RibbonX", since I read a lot of good stuff about it, and, on top of that, know, that It has a certain section for my kind of problem ("there is a section that builds a ribbon on the fly in vba") (UtterAccess Forums > Create New Ribbon Category/buttons W/vba).

I know that this text may be pure rape for native speakers, but I am trying my best guys, so please be patient.

thanks in advance guys (!!), feel free to ask anything if I may have missed important information
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
I assume you can't add the relevant ribbon customisations to the files you are opening?
 
Upvote 0
that's correct. I do not even know the exact amount of files, that could be opened tbh. that's also the reason I am looking for an development-type way to solve this.
 
Upvote 0
I'd stick with the add-ins then. I can't think of a simple way to control the ribbon of another application using purely VBA.
 
Upvote 0
thanks for that quick opinion of yours. that was also what I intended to do, but for average, there is always a solution, and I thought it may be worth finding out.

I am quite positively surprised by the reaction time of those forum mvp's here. :)
 
Upvote 0
besides of that:
would it technicly be possible to impement this code into vba? the solution I tried worked, but I had to restart excel when I tested it on a blank excel sheet. would be stupid if someone had to open the requested file twice, only to see the ribbon based controls^^
 
Upvote 0
Please do not bump your post multiple times the same day.
 
Upvote 0
ok, I am sry for bumping this post again this day, but something changed so I thought I could give it another shot:

I still want to find a way to execute a ribbon based menu when someone opens a file out of the 'parent-file' but what changed is the fact, that we only execute other .xls or excel files in general. So no word .doc's or other office application based stuff. only excel. is it still not worth the efford? my problem was, that I always had to restart excel, to make the 'on-runtime-created-button' available. could I solve this issue by .invalidate ing my ribbon, as I do when the language of the labels is changed?

thanks
 
Upvote 0

Forum statistics

Threads
1,223,445
Messages
6,172,177
Members
452,446
Latest member
walkman99

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top