Excel Object Errors

I'm trying to help out some folks who are using an Excel workbook with macros behind it that I cannot decypher. One of our users can run this but the rest of us can't.

At present, the code blows up on the last line of this code:

Dim InI As Integer
    Dim InJ As Integer
    Dim VaRecLayout_array As Variant
    Dim RnAnchorCell As Range
    Dim WkProgFile As Workbook
    Dim StSheetName As String
    Dim StrArray() As Variant
    Dim ArParse(1 To 2) As Integer
    Dim IntNoCols As Integer
    Dim StDataFilePath As String
    Dim StDataFileName As String
    Dim RnC As Range
    Dim VrResp As Variant
    Dim StFileDate As String
    Dim DblDbControlSum As Double
    Dim DblCrControlSum As Double
    Dim StTrailer As String
    Dim DblDbAmts As Double
    Dim DblCrAmts As Double
    Dim StOutputFile As String
    Dim StProcDate As String
    Dim WkbTRVLRS As Workbook
    Dim fso As New FileSystemObject
    Dim blTrailerFound As Boolean
   
    '----------------------------------------------------------|
    'Intitialize variables
    ReDim ArWkSheets(1)

When I comment out the row, the program blows up with the same error further down. The error is "Cannot load object because it does not exist on this machine."

Obviously there is something in either the Excel settings that needs to be modified, or there is something that needs to be loaded on the other computers that will allow this code to run.

Any suggestions will be appreciated.
Buck_BeasomDatabase DesignerAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
Rory ArchibaldCommented:
Does the user for whom it works have a different version of Excel/Office or Windows to the rest?
0
 
MacroShadowCommented:
ArWkSheets is an array that's not declared.
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
Rory ArchibaldCommented:
You can just use Redim like that without an initial Dim statement.
0
 
MacroShadowCommented:
What i meant to say is that the array was not instantiated.
0
 
Rory ArchibaldCommented:
Not sure what you mean? That line is just redimensioning the array (only objects need to be instantiated)
0
 
MacroShadowCommented:
Which array?
0
 
Rory ArchibaldCommented:
ArWkSheets - isn't that what we were discussing?
0
 
MacroShadowCommented:
Yes, and where is that array populated?
0
 
Rory ArchibaldCommented:
Presumably somewhere later in the code. Not sure I see the relevance of the question as there hasn't been any attempt to use its members?
0
 
Tommy KinardCommented:
isn't ArWkSheets called an object by the compiler? I think this would mean that it may be an  add-in that is not on their machines? Either that or there is a reference that is missing which throws off the compiler.
0
 
Buck_BeasomDatabase DesignerAuthor Commented:
Well, it's nice that all of you are enjoying this discussion, but:

1) The versions are the same and

2) I still have no idea how to diagnose or fix this problem.
0
 
Rory ArchibaldCommented:
I don't believe the error relates directly to your code-I think you have a control in use in the workbook that is not available on some machines.
0
 
MacroShadowConnect With a Mentor Commented:
Compare the references on their machine with those on yours.  If you see one on theirs which says “missing” you've found the culprit.
0
All Courses

From novice to tech pro — start learning today.