Solved

Modify a Excel 2010 ribbon for all users

Posted on 2010-11-08
6
467 Views
Last Modified: 2012-05-10
I am trying to find out if there is a way to modify a Excel 2010 ribbon for all users on one computer without having to do a export/import. From everything I am reading there isn't but I thought I would check with the experts to see if anyone may have found a way.
0
Comment
Question by:Aludaan
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 14

Assisted Solution

by:leoahmad
leoahmad earned 100 total points
ID: 34089664
0
 

Author Comment

by:Aludaan
ID: 34108590
Hey Leoahmad. I was actually looking to be able to set it up on a PC and have a icon show up for everyone using the PC, not just the file. But right now that would be fine but I could never get it to fully work. I included a copy of the script I added but I keep getting a "Wrong number of arguments or invalid property assignment" error or a macro doesn't exist error. Everything I have read online says that this script is correct, and it is such a basic setup I don't see what is wrong with it. If you have any idea I will accept assistance otherwise I may just have to close this and manually configure excel for only select users and force them to have to be the ones to run it all the time.

Thanks.
<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui">
	<ribbon>
		<tabs>
			<tab idMso="TabHome">
				<group id="MyGroup" label="My Group">
					<button id="Button1" label="My Large Button" size="large" onAction="ThisDocument.dcdsrHTML" />
				</group>
			</tab>
		</tabs>
	</ribbon>
</customUI>

Open in new window

0
 
LVL 4

Accepted Solution

by:
theGove earned 400 total points
ID: 34271173
A quick look at your ribbon modification makes me think that the problem deals with the onAction.

The value of onAction needs to be a vba subprocedure that is configured to receive the a reference to the ribbon control that is used to invoke it.  Accordingly, for your ribbon modification to work you would need to have a vba subprocedure defined as follows:
Sub ThisDocument.dcdsrHTML(control As IRibbonControl)
  'code to do whatever is needed
End Sub

Open in new window


The problem is that the procedure name "ThisDocument.dcdsrHTML" is not allowed in VBA.  Procedures names must start with a letter and are limited to letters, numbers and the underscore character.

if I modify your custom ribbon xml to replace" ThisDocument.dcdsrHTML" with "dcdsrHTML" so it shows as follows:
<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui">
	<ribbon>
		<tabs>
			<tab idMso="TabHome">
				<group id="MyGroup" label="My Group">
					<button id="Button1" label="My Large Button" size="large" onAction="ThisDocument.dcdsrHTML" />
				</group>
			</tab>
		</tabs>
	</ribbon>
</customUI>

Open in new window


and add a vba suprocedure in a general module that looks like this:
Sub dcdsrHTML(control As IRibbonControl)
  MsgBox "hi"
End Sub

Open in new window


You ribbon modification works fine for me.
0
Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

 
LVL 4

Expert Comment

by:theGove
ID: 34271229
Now, about getting the ribbon modification to stick around for all users.  I think this can be accomplished quite easily.  Once you have workbook that has the ribbon modification you want, save that workbook as an excel addin.  Just choose File|Save As... and under the "save as type" drop down, select "Excel Add-In."  This will allow you to save the file as an an addin (.xlam) file.  Then you can install this addin into this copy of excel by choosing "File|Options..." This will bring up the "excel options" dialog box.  On the left, select "add in" and then at the bottom of the right pane where it says "manage", choose "Excel Add-ins" and click "GO"  If you saved the addin in the default location, you should see it in the list to of addins--you can just click it and say "OK."  If it is not already showing, click the "Browse" button an locate the file you saved as an .xlam file.

I think this will make the ribbon modifications permanent for all users.
0
 

Author Comment

by:Aludaan
ID: 34315367
Thanks theGove. I will give that a shot.
0
 

Author Closing Comment

by:Aludaan
ID: 34337140
Thanks theGove. That worked.
0

Featured Post

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Microsoft Office Picture Manager was included in Office 2003, 2007, and 2010, but not in Office 2013. Users had hopes that it would be in Office 2016/Office 365, but it is not. Fortunately, the same zero-cost technique that works to install it with …
Outlook Free & Paid Tools
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question