Solved

Excel Object Errors

Posted on 2013-05-10
14
322 Views
Last Modified: 2013-05-28
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.
0
Comment
Question by:Buck_Beasom
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
14 Comments
 
LVL 85

Expert Comment

by:Rory Archibald
ID: 39155075
Does the user for whom it works have a different version of Excel/Office or Windows to the rest?
0
 
LVL 27

Expert Comment

by:MacroShadow
ID: 39155081
ArWkSheets is an array that's not declared.
0
 
LVL 85

Expert Comment

by:Rory Archibald
ID: 39155095
You can just use Redim like that without an initial Dim statement.
0
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 
LVL 27

Expert Comment

by:MacroShadow
ID: 39155136
What i meant to say is that the array was not instantiated.
0
 
LVL 85

Expert Comment

by:Rory Archibald
ID: 39155174
Not sure what you mean? That line is just redimensioning the array (only objects need to be instantiated)
0
 
LVL 27

Expert Comment

by:MacroShadow
ID: 39155200
Which array?
0
 
LVL 85

Expert Comment

by:Rory Archibald
ID: 39155273
ArWkSheets - isn't that what we were discussing?
0
 
LVL 27

Expert Comment

by:MacroShadow
ID: 39155300
Yes, and where is that array populated?
0
 
LVL 85

Expert Comment

by:Rory Archibald
ID: 39155325
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
 
LVL 14

Expert Comment

by:Tommy Kinard
ID: 39156203
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
 

Author Comment

by:Buck_Beasom
ID: 39165524
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
 
LVL 85

Expert Comment

by:Rory Archibald
ID: 39166319
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
 
LVL 27

Accepted Solution

by:
MacroShadow earned 500 total points
ID: 39169132
0
 
LVL 27

Assisted Solution

by:MacroShadow
MacroShadow earned 500 total points
ID: 39169146
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

Featured Post

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
Outlook for dependable use in a very small business   This article is about using the Outlook application (part of Microsoft Office) in a very small business, or for homeowners where dependability and reliability are critical requirements. This …
Learn how to create and modify your own paragraph styles in Microsoft Word. This can be helpful when wanting to make consistently referenced styles throughout a document or template.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

718 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question