Solved

Modify a Excel 2010 ribbon for all users

Posted on 2010-11-08
6
434 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
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 
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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

In case Office 2010 has not been deployed in your environment, this article may be quite useful. In our office, we wanted a way to deploy Microsoft Office Professional Plus 2010 through an automated batch file via logon script. This article is docum…
Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.

707 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

16 Experts available now in Live!

Get 1:1 Help Now