Solved

Modify a Excel 2010 ribbon for all users

Posted on 2010-11-08
6
442 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

This tutorial explains how to create a series of drop-down lists that are dependent upon prior selections to guide (“force”) the user to make the correct selection and reduce data errors within Microsoft Excel. Excel 2010 was used for this tutorial;…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.

932 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now