none
Upgrading an Excel 2003 macros for Excel 2010 - "File not found: VBA6.dll" RRS feed

  • Question

  • Hi all,

    I've been tasked with making a Excel 2003 spreadsheet containing macros compatible under Excel 2010.

    When trying to run various pieces of macro code, I receive the "File not found: VBA6.DLL" error. This error message occurs straightaway, before stepping into the code.

    I've checked that the references do not refer to VBA6.DLL

    Additionally, I've checked where this should be installed, and it isn't there.

    C:\Program Files (x86)\Common Files\microsoft shared\VBA\VBA6\  (there is a VBE6EXT.OLB file)

    Should this file be there under installation of Excel 2010? (I'd presume not as it would be using VBA7). As the spreadsheet is to be distributed company-wide, adding VBA6.dll on my machine won't help as everyone will have the same issue.

    Ideally I'd like to remove any references to VBA6.DLL

    Any advice appreciated!

    Richard

    An example bit of code:

    Private Sub PrepareForSavingTemplate()

       
        On Error Resume Next
        With ThisWorkbook.Worksheets("RRTemplate")
            .Unprotect strPassword
            .Visible = xlSheetVisible
            .Delete
        End With
        On Error GoTo 0
        With ThisWorkbook.Worksheets("Blank Risk Template")
            .Unprotect strPassword
            .Copy before:=ThisWorkbook.Worksheets("Blank Risk Template")
            .Protect Password:=strPassword, DrawingObjects:=True, Contents:=True, Scenarios:=True
        End With
        With ThisWorkbook.Worksheets("Blank Risk Template (2)")
            .Name = "RRTemplate"
            .Protect Password:=strPassword, DrawingObjects:=True, Contents:=True, Scenarios:=True
            .Visible = xlSheetVeryHidden
        End With
        MsgBox "Done!", vbInformation, ""
       
    End Sub



    • Edited by Richard Lamb Wednesday, June 12, 2013 3:02 PM spelling
    Wednesday, June 12, 2013 2:54 PM

Answers

  • Hi Richard

    That's true. Visual Basic For Application is now Version 7 (VBE7.DLL). You can try to replace the broken reference by a reference to:

    C:\Program Files (x86)\Common Files\Microsoft Shared\VBA\VBE7.DLL

    Actually, this one should be in by default and not removeable. Just remove the reference to VBA6.DLL.

    Hopefully this one has the same objects and methods inside so your macro runs correctly.

    BTW: It's independend if you have Win7 in 32 or 64 bit version installed. It only depends on the Office version. For the 64-bit version of Office there is also a 64-bit version of the DLL.

    HTH

    Henry


    Wednesday, June 12, 2013 4:27 PM
  • Found another thread: Excel file not found: VBA6.DLL

    Henry

    Wednesday, June 12, 2013 4:32 PM

All replies

  • What version of Office did you install? 32- or 64-bit version? VB6.DLL is a 32-bit DLL that will not run in the 64-bit Office. To use it you need the 32-bit version of Office 2010 installed which is the recommended install of Microsoft.

    Henry

    Wednesday, June 12, 2013 3:10 PM
  • Henry - thanks for your response.

    According to my Office, it is Version:14.0.6129.5000 (32-bit)

    Therefore, would I expect to have VBA6.DLL installed?

    (I should note that Win 7 itself on my laptop is 64-bit)


    Wednesday, June 12, 2013 3:36 PM
  • Hi Richard

    That's true. Visual Basic For Application is now Version 7 (VBE7.DLL). You can try to replace the broken reference by a reference to:

    C:\Program Files (x86)\Common Files\Microsoft Shared\VBA\VBE7.DLL

    Actually, this one should be in by default and not removeable. Just remove the reference to VBA6.DLL.

    Hopefully this one has the same objects and methods inside so your macro runs correctly.

    BTW: It's independend if you have Win7 in 32 or 64 bit version installed. It only depends on the Office version. For the 64-bit version of Office there is also a 64-bit version of the DLL.

    HTH

    Henry


    Wednesday, June 12, 2013 4:27 PM
  • Found another thread: Excel file not found: VBA6.DLL

    Henry

    Wednesday, June 12, 2013 4:32 PM
  • Hi Richard,

    Welcome.

    I temporarily marked the replies as answers and you can unmark them if they provide no help.

    Please feel free to let us know if you have any concern/question.

    Thanks for your understanding and have a nice day.


    Yoyo Jiang[MSFT]
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Friday, June 28, 2013 9:53 AM
    Moderator