Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7655513
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T12:31:56+00:00 2026-05-31T12:31:56+00:00

I have an Excel workbook with dependencies on code in other other Excel workbooks

  • 0

I have an Excel workbook with dependencies on code in other other Excel workbooks (these dependent .xls’s are VB-level references, i.e. via the Tools->References dialog box in the VBA editor), and some dependencies on dll’s such as:
Microsoft Scripting Runtime
Microsoft Forms 2.0 Object Library

This sheet has worked for about 2 years on around 20 machines running Windows XP and Office XP. Recently we have taken delivery of 3 new machines (same OS, same office version) which refuse to run this sheet. When the sheet opens, it throws a ‘Compile Error’, and the session hangs.

If I open the sheet on a ‘bad’ machine, hold down the left shift key to stop macro’s from running, and then go to VBA Editor->Debug->Complie VBAProject, it compiles fine. I am then able to save the sheet and open it normally on a ‘bad’ machine. However this new version of the sheet refuses to run on a ‘good’ machine!!

I think there must be some sort of version mismatch between certain dll’s on the ‘good’ and ‘bad’ machines. How do I establish what is causing the issue? Are there any tools available for comparing versions of com components?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T12:31:56+00:00Added an answer on May 31, 2026 at 12:31 pm

    Two suggestions

    1) First open the file with macros disabled. And then check VBA Editor | Tools | References. Check for any missing references and then let us know what are they. We will take it from there.

    2) For references like “Microsoft Scripting Runtime Object Library” I never use Early Binding. Early Binding is the major cause for these kind of errors. Just FYI: Early Binding is creating references beforehand via VBA Editor | Tools | References. I would recommend changing your code to Late Binding. Here are 2 examples of the same code using “Microsoft Scripting Runtime Object Library” with Early Binding and Late Binding

    EARLY BINDING EXAMPLE

    '~~> Set Reference to "Microsoft Scripting Runtime Object Library"
    
    Sub EBExample()
        Dim FSO As Scripting.FileSystemObject
        Dim SourceFolder As Scripting.Folder
        Dim FileItem As Scripting.File
    
        Set FSO = New Scripting.FileSystemObject
        Set SourceFolder = FSO.GetFolder(SourceFolderName)
    
        For Each FileItem In SourceFolder.Files
            '~~> You code
        Next FileItem
    End Sub
    

    LATE BINDING EXAMPLE

    '~~> This doesn't need a reference
    Sub LBExample()
        Dim FSO As Object, SourceFolder As Object, FileItem As Object
    
        Set FSO = CreateObject("Scripting.FileSystemObject")
        Set SourceFolder = FSO.GetFolder(SourceFolderName)
    
        For Each FileItem In SourceFolder.Files
            '~~> You code
        Next FileItem
    End Sub
    

    As for me I use early binding to take advantage of Intellisense but then convert it to late binding to avoid version-specific code before distributing the code. That ways the code always works. 🙂

    IMP NOTE: Late Binding fails in scenarios where the destination machine doesn’t have the relevant dll registered.

    RECOMMENDED LINK:

    Topic: Using early binding and late binding in Automation

    Link: http://support.microsoft.com/kb/245115

    Hope this helps

    Sid

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I currently have a excel workbook that has values being pulled from other workbooks
I have an Excel Workbook which has some VSTO-based c# code. Given a known
I have some VBA code in an Excel workbook. I have a cell which
I have an Excel workbook with a custom non-time-dependent cell function that I am
I have an Excel workbook, which using VBA code that opens another workbook, copies
We have an Excel workbook which has c# VSTO code in it and two
We have an Excel workbook with a number of ActiveX controls, running in Excel
I have an excel workbook vsto solution that needs to generate a pdf copy
I have an Excel workbook that I want to use as a template. It
I have an Excel Workbook that has several worksheets in it. The tables in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.