Solved

Modify a Excel 2010 ribbon for all users

Posted on 2010-11-08
6
459 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
  • 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
Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

 
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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Recently Microsoft released a brand new function called CONCAT. It's supposed to replace its predecessor CONCATENATE. But how does it work? And what's new? In this article, we take a closer look at all of this - we even included an exercise file for…
When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
Learn how to create and modify your own paragraph styles in Microsoft Word. This can be helpful when wanting to make consistently referenced styles throughout a document or template.
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.

829 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