SharedControls - code for Custom UI Editor error to fix
-
jeudi 2 août 2012 08:58
Working on a project in Excel and being new in programming facing difficulties to accomplish the project. The following code gives the error massage. Could you please assist to correct the code? Any help is highly appreciated.
Error massage is:
The element ‘qat’ in namespace
http://schemas.microsoft.com/office/2009/07/customui has invalid child element ‘SharedControls’ in namespaceetc.
Here is the code:
<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui">
<ribbon>
<qat>
<SharedControls>
<control idMso="FilePrintQuick" label="Shared FilePrintQuick"/>
<control idMso="FileSave" label="Shared FileSave"/>
<control idMso="FileSaveAs" label="Shared FileSaveAs"/>
<control idMso="Undo" label="Shared Undo"/>
<control idMso="Redo" label="Shared Redo"/>
</SharedControls>
</qat>
</ribbon>
</customUI>
Toutes les réponses
-
jeudi 2 août 2012 13:08
Beware the xml tags/attributes are case sensitve.
<sharedControls>
lower case shared
This will then take you to the next problem which is the startfromscratch attribute needs to be set.
<ribbon startFromScratch="true">
Cheers,
Andy
www.andypope.info- Modifié Andy Pope [mvp]MVP jeudi 2 août 2012 13:11 extra info
-
dimanche 5 août 2012 19:59
Hi Andy
You are absolutely right, thanks a lot for helping alien in programming.
Here is the working code
<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui">
<ribbon startFromScratch="true">
<qat>
<sharedControls>
<control idMso="PrintPreviewAndPrint" label="Shared PrintPreviewAndPrint "/>
<control idMso="FileSave" label="Shared FileSave"/>
<control idMso="FileSaveAs" label="Shared FileSaveAs"/>
<control idMso="Undo" label="Shared Undo"/>
<control idMso="Redo" label="Shared Redo"/>
</sharedControls>
</qat>
</ribbon>
</customUI>
Cheers and thanks again
P.S.
One question remains for me not answered.
Is it possible to have “Customize Quick Access Toolbar” in the header line when workbook is set to open in Full screen mode based on the following VBA?
Private Sub Workbook_Open()
Sheets("Main").Select
Set myRange = ActiveSheet
Application.ScreenUpdating = False
Application.ExecuteExcel4Macro "SHOW.TOOLBAR(""Ribbon"",False)"
Application.DisplayFormulaBar = False
Application.DisplayStatusBar = Not Application.DisplayStatusBar
ActiveWindow.DisplayWorkbookTabs = TrueDim wbBook As Workbook
Dim wsSheet As WorksheetSet wbBook = ThisWorkbook
For Each wsSheet In wbBook.Worksheets
Rem If Not wsSheet.Name = "Blank" Then wsSheet.Activate
With ActiveWindow
.DisplayHeadings = False
.DisplayGridlines = False
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True, AllowFormattingRows:=True
ActiveSheet.EnableSelection = xlUnlockedCells
End With
Next wsSheetmyRange.Select
End Sub
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Set myRange = ActiveSheet
Application.ScreenUpdating = False
Application.ExecuteExcel4Macro "SHOW.TOOLBAR(""Ribbon"",True)"
Application.DisplayFormulaBar = True
Application.DisplayStatusBar = True
ActiveWindow.DisplayWorkbookTabs = TrueDim wbBook As Workbook
Dim wsSheet As WorksheetSet wbBook = ThisWorkbook
End Sub
Regards Gio- Marqué comme réponse Leo_GaoModerator vendredi 10 août 2012 01:43
-
lundi 6 août 2012 08:31
The QAT is not display in full screen mode.
You would have to maximize the application instead of using Full screen to retain the QAT
Cheers,
Andy
www.andypope.info- Marqué comme réponse Leo_GaoModerator vendredi 10 août 2012 01:41
- Non marqué comme réponse Leo_GaoModerator vendredi 10 août 2012 01:42
- Marqué comme réponse Leo_GaoModerator vendredi 10 août 2012 01:43
-
samedi 11 août 2012 22:08
Thanks and Cheers

