none
Macros into excel 2016 RRS feed

  • Question

  • I have a group of macros inside xlam file; which are called from icons under custom items tab.

    1. The macros and icons run well from excel 2013.
    2. When executing the icons (from the custom items tab) in excel 2016 I get the error Your excel version is not supported; however, under VBA, I am able to execute from inside the macro/debug.

    How can I get the icons to work from custom items tab in excel 2016?




    • Edited by Benny Gabel Sunday, November 5, 2017 2:56 PM
    Sunday, November 5, 2017 2:51 PM

Answers

  • Hello,

    Do you create the add-in? 

    In the xlam, there is a function to check supported version. It shows the developer specifies the add-in supports Office 2007- 2013.  So you get the message when you run the add-in in Office 2016.

    Function SupportedVersion(tcVersionNumber As String) As Boolean
    
        '12.0 = 2007
        '14.0 = 2010
        '15.0 = 2013
    
        If tcVersionNumber = "12.0" _
        Or tcVersionNumber = "14.0" _
        Or tcVersionNumber = "15.0" Then
            
            SupportedVersion = True
                
        Else
        
            SupportedVersion = False
            MsgBox "Your Excel Version is not supported"
        
        End If
    
    End Function

    For resolving this error, you could try code below:

    Function SupportedVersion(tcVersionNumber As String) As Boolean
        '12.0 = 2007
        '14.0 = 2010
        '15.0 = 2013
        '16.0 = 2016
        If tcVersionNumber = "12.0" _
        Or tcVersionNumber = "14.0" _
        Or tcVersionNumber = "15.0" _
        Or tcVersionNumber = "16.0" Then
            SupportedVersion = True
        Else
            SupportedVersion = False
            MsgBox "Your Excel Version is not supported"
        End If
    End Function

    Regards,

    Celeste


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.


    Tuesday, November 21, 2017 7:26 AM
    Moderator

All replies

  • Hello,

    What code do you use? How do you add the custom tab? Do you customize Office UI using VBA code or add the custom tab via Excel Options -> Customize Ribbon -> New tab?

    What is your Office build version? Do you test if the code works in other machines?

    Regards,

    Celeste


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, November 6, 2017 1:57 AM
    Moderator
  • The icons/macros are created under the custom items tab.

    As I mentioned before, they run on every machine that has Excel 2013, but not under Excel 2016.

    The icons are created when I add them xlam file as Add-In.

    I also downloaded the custom UI Editor for Microsoft Office. What should I look in there?

    What is the difference between customUI14.xml and customUI.xlm

    Monday, November 6, 2017 1:21 PM
  • Hello,

    customUI14.xml and customUI.xml have different namespaces.

    In customUI.xml, it is <customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui">

    In customUI14.xml, it is <customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui">

    From Office 2010, Context Menu and Backstage are added, so it requires new namespace http://schemas.microsoft.com/office/2009/07/customui

    I suggest you insert customUI14.xml part and use http://schemas.microsoft.com/office/2009/07/customui as the schema/xml namespace.

    Besides, please check "Show add-in user interface errors" in Excel Options -> Advanced -> General to see if there is any UI error like wrong idMso in your custom xml.

    Regards,

    Celeste


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Tuesday, November 7, 2017 7:23 AM
    Moderator
  • Celeste,

    Thank you for all your help until now.

    I changed the setup as you advise me, however, am not sure where to look for any interface error, as don't see anything different on the excel, nor messages popped up

    Wednesday, November 8, 2017 10:31 PM
  • Hello,

    Please re-open Excel. If there is no error, could you please share your add-in file or your custom XML here? I would test if the XML works for me.

    Regards,

    Celeste


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, November 9, 2017 1:23 AM
    Moderator
  • I don't have an XML file, only an XLAM.

    Is there a way to upload that file?

    Thursday, November 16, 2017 2:55 AM
  • Hello,

    Please upload your file into OneDrive and share the link here. Please visit Share OneDrive files and folders

    Regards,

    Celeste


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, November 16, 2017 6:33 AM
    Moderator
  • I put the file in DropBox, can you give me an email for me to share it with?

    My office license is for a desktop, and do not have office 365 subscription, therefore am having troubles using One Drive; but as I said, please send me an email address an I will be able to share the file with you.

    Thank you.

    Monday, November 20, 2017 1:55 PM
  • Hi Benny,

    You could share us the link in DropBox, or, you could send the file to me by tonyhelp@outlook.com, I will help to share it.

    Regards,

    Tony


    Help each other

    Monday, November 20, 2017 2:43 PM
  • Thank you, Tony. I shared the file with your email.
    Monday, November 20, 2017 10:43 PM
  • Hi all,

    The file from Benny is below:

    https://1drv.ms/x/s!AsyeWQ2z51P3hFva-pVXsTd-j6aW

    Regards,

    Tony


    Help each other

    Tuesday, November 21, 2017 1:24 AM
  • Hello,

    Do you create the add-in? 

    In the xlam, there is a function to check supported version. It shows the developer specifies the add-in supports Office 2007- 2013.  So you get the message when you run the add-in in Office 2016.

    Function SupportedVersion(tcVersionNumber As String) As Boolean
    
        '12.0 = 2007
        '14.0 = 2010
        '15.0 = 2013
    
        If tcVersionNumber = "12.0" _
        Or tcVersionNumber = "14.0" _
        Or tcVersionNumber = "15.0" Then
            
            SupportedVersion = True
                
        Else
        
            SupportedVersion = False
            MsgBox "Your Excel Version is not supported"
        
        End If
    
    End Function

    For resolving this error, you could try code below:

    Function SupportedVersion(tcVersionNumber As String) As Boolean
        '12.0 = 2007
        '14.0 = 2010
        '15.0 = 2013
        '16.0 = 2016
        If tcVersionNumber = "12.0" _
        Or tcVersionNumber = "14.0" _
        Or tcVersionNumber = "15.0" _
        Or tcVersionNumber = "16.0" Then
            SupportedVersion = True
        Else
            SupportedVersion = False
            MsgBox "Your Excel Version is not supported"
        End If
    End Function

    Regards,

    Celeste


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.


    Tuesday, November 21, 2017 7:26 AM
    Moderator
  • Thank you Chenchen
    Thursday, November 23, 2017 10:17 AM