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?
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
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
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.
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?
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?
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.