Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

PowerPoint AddIn/Custom Ribbon generating macro error

Posted on 2010-01-08
6
Medium Priority
?
941 Views
Last Modified: 2012-05-08
Howdy! I've set up an AddIn in PowerPoint that generates a custom menu on the ribbon with macros assigned to buttons. When I open the AddIn or the original .pptm used to create it, PowerPoint tells me..."The macro cannot be found or has been disabled because of your security settings." I've already got macros enabled and I'm the author so I'm not sure what the problem is. There is only one module and all of the macros function properly. Any ideas about what might be causing this mildly irritating message?
0
Comment
Question by:behest
  • 3
  • 3
6 Comments
 
LVL 23

Expert Comment

by:JSRWilson
ID: 26272872
Maybe if you post the vba and xml you are using?
0
 

Author Comment

by:behest
ID: 26278802
Ah yes! Below is the VBA code...There are 5 macros that all follow this format (only difference is whick border the formatting is applied to).

Sub DoubleUnderline(control As IRibbonControl)
Dim iRow As Integer
Dim iCol As Integer
Dim iBorder As Integer
Dim otbl As Table
On Error Resume Next
Set otbl = ActiveWindow.Selection.ShapeRange(1).Table
For iRow = 1 To otbl.Rows.Count
For iCol = 1 To otbl.Columns.Count
If otbl.Cell(iRow, iCol).Selected Then
For iBorder = 3 To 3
otbl.Cell(iRow, iCol).Borders(iBorder).Visible = msoTrue
With otbl.Cell(iRow, iCol).Borders(iBorder)
.Weight = 3
.ForeColor.RGB = vbBlack
.Style = msoLineThinThin
.Visible = True
End With
Next iBorder
End If
Next iCol
Next iRow
End Sub

Here'e the XML...

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<customUI onLoad="RibbonOnLoad" xmlns="http://schemas.microsoft.com/office/2006/01/customui">
<ribbon>
<tabs>
<tab id="MyCustomTab" label="Table Borders" insertAfterMso="TabHome" > 

<group id="customGroup1" label="Table Borders">
<button id="customButton1" label="No Border" onAction="NoBorder" imageMso="BorderNone" />
<button id="customButton2" label="1Bottom" onAction="SingleUnderline" imageMso="BorderBottom" />
<button id="customButton3" label="2Bottom" onAction="DoubleUnderline" imageMso="DoubleBottomBorder" />
<separator id="MySeparator1" />
<button id="customButton4" label="1Top1Bottom" onAction="SingleSingle" imageMso="BorderTopAndBottom" />
<button id="customButton5" label="1Top2Bottom" onAction="SingleDouble" imageMso="BorderTopAndDoubleBottom" />
<button id="customButton6" label="2Top2Bottom" onAction="DoubleDouble" imageMso="UnderlineDouble" />
</group>
</tab>
</tabs>
</ribbon>
</customUI>
0
 
LVL 23

Expert Comment

by:JSRWilson
ID: 26281943
Hi

It worked for me (nice vba - I think I recognise it)

I did get the warning but thats becasue I  don't have 5 of the six macros. The one I have did work from the new tab.

Are you sure all of the six are there and have the exact names as in the xml (case IS important.)

Minor point - if you are only setting one border you don''t need the  iBorder /For Next Loop


For iRow = 1 To otbl.Rows.Count
For iCol = 1 To otbl.Columns.Count
If otbl.Cell(iRow, iCol).Selected Then
With otbl.Cell(iRow, iCol).Borders(3)
.Visible = msoTrue
.Weight = 3
.ForeColor.RGB = vbBlack
.Style = msoLineThinThin
.Visible = True
End With
End If
Next iCol
Next iRow

Open in new window

0
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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.

 

Author Comment

by:behest
ID: 26287550
Hi and thanks for your help. Based on your comment about getting the error message, I went in to the xml and deleted out all of the button lines except the double underline (updated the button # to 1). Then I deleted all of the Subs except the double underline sub. Saved, replaced files as necessary and opened it again. names match, btw.
Yikes! I still get the error. Does the same thing happen to you? I've used this same xml code for an excel ribbon customization and don't have this issue. So, I'm wondering if something in my _rels might be the problem (code provided below).

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship Id="rId3" Type="http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties" Target="docProps/core.xml"/><Relationship Id="rId2" Type="http://schemas.openxmlformats.org/package/2006/relationships/metadata/thumbnail" Target="docProps/thumbnail.jpeg"/><Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument" Target="ppt/presentation.xml"/><Relationship Id="rId4" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties" Target="docProps/app.xml"/><Relationship Id="customUIRelID" Type="http://schemas.microsoft.com/office/2006/relationships/ui/extensibility" Target="customUI/customUI.xml" /></Relationships>
Other than that, I'm at a loss...
0
 
LVL 23

Accepted Solution

by:
JSRWilson earned 500 total points
ID: 26290829
Try this xml instead

<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui">
	<ribbon>
		<tabs>
			<tab id="CustomTab1" insertAfterMso="TabHome" label="Table Borders">
				<group id="CustomGroup1" label="Table Borders">
					<button id="Custombutton1" onAction="DoubleUnderline" imageMso="DoubleBottomBorder" label="Double Bottom" />
				</group>
			</tab>
		</tabs>
	</ribbon>
</customUI>

Open in new window

0
 

Author Comment

by:behest
ID: 26299987
Most excellent! Thank you very much!!! Out of curiosity, was it the
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
or the onLoad command?
And why?
Again, I thank you most effusively!
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

Have you ever been sent a PowerPoint presentation file and wondered why it filled your mailbox? Or have you ever sent a PowerPoint presentation by email and received complaints about the size? Or have you ever created a PowerPoint presentation and t…
A lot of things can happen during a presentation, worst of which is “death by PowerPoint.” Here are a few mistakes to avoid to make your slides clean.
The viewer will learn how to edit text. This includes Font, Spacing, Resizing, Color, and other special text options.
The viewer will learn how to  create a slide that will launch other presentations in Microsoft PowerPoint. In the finished slide, each item launches a new PowerPoint presentation and when each is finished it automatically comes back to this slide: …
Suggested Courses

571 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