Link to home
Start Free TrialLog in
Avatar of Hankwembo Christopher,FCCA,FZICA,CIA,MAAT,B.A.Sc
Hankwembo Christopher,FCCA,FZICA,CIA,MAAT,B.A.ScFlag for Zambia

asked on

Ribbons design in Ms Access 2016

Just for consultation purpose , I want to maintain the in-belt Ribbon preview button and at the same time adding my excel export other programs export function in my ms access app.kindly see whether this is okay with you.

<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui">
<ribbon> 
<tabs>
            <tab id="grpRprt1" label="Export Reports">
                
                <group id="grpRprt3" label="Export">
                    <control idMso="ExportExcel"  visible="true"  size="large" /> 
                    <separator id="sprtrRpt1" />
                    <control idMso="ExportWord" visible="true"  size="large" />
                    <separator id="sprtrRpt2" />
                    <control idMso="ExportTextFile"  visible="true" size="large" />
                    <separator id="sprtrRpt3" />
                    <button idMso="FileSaveAsPdfOrXps" visible="true" size="large" />
                </group>
            </tab>
        </tabs>
    </ribbon>
</customUI>

Open in new window


I have also noticed that the export is using 97 to 2003 is it possible to change it so that it starts from 2003 to 2016?

Regards

Chris
ASKER CERTIFIED SOLUTION
Avatar of Scott McDaniel (EE MVE )
Scott McDaniel (EE MVE )
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
You would better with a custom function assigned to the Ribbon button
 <button id="ExportToXLSX"  visible="true" size="large" imagemso = "ChartShowData"
onAction="exportToXLSX" />

Open in new window

and the function
Public Function exportToXLSX(ctl As IRibbonControl)
Dim curPath As String
curPath = CurrentProject.Path & "\YourExcel"
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel12, "YourTable", curpath, True

End Function

Open in new window

Last but not least you need a reference to Microsoft Office 16 Object Library (change 16 to your version)