Results 1 to 8 of 8

Thread: Could not load objects

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2004
    Location
    Bloomingdale, IL USA
    Posts
    284

    Could not load objects

    I have an excel file that contains VB forms with many controls. On certain
    machines, when the file is opened, I recieve the following error message:
    "Could not load some objects because they are not available on this machine". When you hit "ok" to the errors (it comes up multiple times), then the form loads fine with no missing objects. After saving it on the machine, the error no longer appears.

    Any suggestions on why this is happening would be greatly appreciated. Thanks.

  2. #2
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Could not load objects

    Usually you get these kind of errors when loading a VB project from someone
    else's machine. This usually means that a control (ocx) may not be on the
    users machine.

    What does the error message state exactly? Is it prompting you that it needs
    to be configured or ??? and then takes you through the Office Excel
    configuration asking you for the Excel CD, maybe?

    What controls/references are in your workbook? VB controls added through
    references in the VBA Editor?
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2004
    Location
    Bloomingdale, IL USA
    Posts
    284

    Re: Could not load objects

    "Could not load some objects because they are not available on this machine" is the exact message. I created the file on my PC, then when it gets emailed to someone, and they open it on thier machine, that is when they get the message. But not every machine shows that error.

    The following references are checked:

    Visual Basic for Applications
    Microsoft Excel 10.0 Object library
    OLE Automation
    MS Forms 2.0 Object Library
    MS Office 10.0 Object Library
    MS ActiveX Data Objects 2.0 Library

    The following controls are the only ones selected:

    Microsoft Forms 2.0 CheckBox
    Microsoft Forms 2.0 ComboBox
    Microsoft Forms 2.0 CommandButton
    Microsoft Forms 2.0 Frame
    Microsoft Forms 2.0 Label
    Microsoft Forms 2.0 ListBox
    Microsoft Forms 2.0 OptionButton
    Microsoft Forms 2.0 ScrollBar
    Microsoft Forms 2.0 textBox

  4. #4
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Could not load objects

    Ah! It is probably from the version of Office and Excel not being the same
    versions on the other workstations. But since you may be using functions /
    controls that are common to all versions (so far) there is no loss of functionality.

    Try to get info to verify this. Ask the receipients what version of Excel they are running and OS as well.

    THT
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2004
    Location
    Bloomingdale, IL USA
    Posts
    284

    Re: Could not load objects

    All OP's are Windows XP. My computer has Excel 2002 SP3, the two that are getting the error have Excel 2002 (no SP3). One has Windows 98 & Excel 97 SR-2 & it has no errors.

  6. #6
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Could not load objects

    Since it runs on Excel 97, then I would just change the code to use late binding where applicable.
    Could you post some of your code?
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  7. #7

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2004
    Location
    Bloomingdale, IL USA
    Posts
    284

    Re: Could not load objects

    There is quite a bit of code, I'm not really sure what late binding is. What kind of code would you like me to post... using db fields, or excel objects?

  8. #8
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Could not load objects

    There are so many things it could be. Late binding is when you declare an
    object as an actual Object and not as a New something kind of object.

    Code:
    Dim oEarlyApp as excel.application 'Early binding
    Dim oLateApp as Object 'Late binding
    
    Set oEarlyApp = New Excel.Application
    Set oLateApp = CreateObject("Excel.Application")
    '...
    What late binding does is allows the program to start without knowing the
    type / version of object that is required for the procedure to load. So if you
    just say object versus Excel version 10.0 it will load. Then when it executes
    it will just need to validate that the properties/methods/events are valid for
    executing. If Excel 10 has a method like using personal menus and 97 tries to
    execute it there will be an error, but if 97 is just setting the app.visible = true
    it is the same in 2002 so no error.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

Posting Permissions

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



Click Here to Expand Forum to Full Width