+ Reply to Thread
Results 1 to 7 of 7

Excel 2003 addins in Excel 2007

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    06-12-2006
    Location
    Portugal
    MS-Off Ver
    Microsoft 365 Apps for enterprise
    Posts
    212

    Excel 2003 addins in Excel 2007

    Hello to everyone.

    I just installed Office 2007 and started receiving a lot of errors when loadind addins written in the Excel 2003 version. Does this mean that i have to re-write all code under the Excel 2007 version?

    Thanks in advance for any help.

    Octavio

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Excel 2003 addins in Excel 2007

    Some coding needs to be different, what sort of errors are you getting.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Forum Contributor
    Join Date
    06-12-2006
    Location
    Portugal
    MS-Off Ver
    Microsoft 365 Apps for enterprise
    Posts
    212

    Re: Excel 2003 addins in Excel 2007

    Thank you for your prompt answer. The following lines of code are ignored.

    Dim cMenu1 As CommandBarControl
    Dim cbMainMenuBar As CommandBar
    Dim iHelpMenu As Integer
    Dim cbcCustomMenu As CommandBarControl
    Dim connectStat As Boolean
    
    On Error GoTo erro
    
    Application.CommandBars("Worksheet Menu Bar").Controls("Iv&a").Delete
    On Error GoTo erro
     Set cbMainMenuBar = Application.CommandBars("Worksheet Menu Bar")
     iHelpMenu = cbMainMenuBar.Controls("Help").Index
    
       Set cbcCustomMenu = cbMainMenuBar.Controls.Add(Type:=msoControlPopup, Before:=iHelpMenu)
         '(5)Give the control a caption
         cbcCustomMenu.Caption = "Iv&a"
         cbcCustomMenu.TooltipText = "Dados para cálculo IVA"
    Thank you
    Octavio

  4. #4
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Excel 2003 addins in Excel 2007

    Excel 2007 does not support menus & Toolbars.


    If you look in the Addins Tab you should find the addins

  5. #5
    Forum Contributor
    Join Date
    06-12-2006
    Location
    Portugal
    MS-Off Ver
    Microsoft 365 Apps for enterprise
    Posts
    212

    Re: Excel 2003 addins in Excel 2007

    Ok, see that i have to re-write some code.

    Thanks a ton for your kind help.

    Octavio

  6. #6
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Excel 2003 addins in Excel 2007

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save

  7. #7
    Forum Contributor
    Join Date
    06-12-2006
    Location
    Portugal
    MS-Off Ver
    Microsoft 365 Apps for enterprise
    Posts
    212

    Re: Excel 2003 addins in Excel 2007

    Hello Roy.

    I believe your answer is not 100% correct.
    I found out that Excel 2007 accepts the code with a few changes, as follows:

    Private Sub Workbook_Open()
    
    On Error GoTo erro
    Dim cbr As CommandBar
    Dim ctlMenu As CommandBarControl
    Set cbr = Application.CommandBars("Worksheet Menu Bar")
    If ctlMenu Is Nothing = False Then
    Set ctlMenu = cbr.Controls.Add(Type:=msoControlPopup)
        With ctlMenu
            .Caption = "IVA"
            With .Controls.Add(Type:=msoControlButton)
                .Caption = "Parâmetros"
                .OnAction = "VatParam"
            End With
    
            With .Controls.Add(Type:=msoControlButton)
                .Caption = "Resumo"
                .OnAction = "FazResumo"
            End With
    
            With .Controls.Add(Type:=msoControlButton)
                .Caption = "Recapitulativo"
                .OnAction = "Recap"
            End With
    
        End With
    End If
    End Sub
    Thank you, anyway.
    Octavio

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1