Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

ActiveX component/reference for FileSystemObject??

Posted on 1999-07-09
14
Medium Priority
?
548 Views
Last Modified: 2008-03-03
I am using the following code:

Dim fs
Set fs = CreateObject("Scripting.FileSystemObject")

I get this error when I run on some systems:
Error 429
'ActiveX component can't create object'

I debugged my program and found that it is thrown by this line:

Set fs = CreateObject("Scripting.FileSystemObject")

So I think I need to add a reference/component for
this object since I am creating it dynamically?
I tried adding the reference:
'Microsoft Scripting Runtime'
but still have problem. Anyone know what activeX reference/
component I need to add to my project????
I have no clue what to add and MSDN sheds no light

thx
0
Comment
Question by:gre
[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
  • 7
  • 4
  • 2
  • +1
14 Comments
 
LVL 2

Expert Comment

by:jrmcg
ID: 1523166
Have you tried to do it this way...?

Dim fs As New FileSystemObject

and if you have does it produce the same results?

J.R.
0
 
LVL 1

Expert Comment

by:alex1234
ID: 1523167
You are getting this error because the object "Scripting.FileSystemObject" either doesn't exist (no DLL or EXE provided) or is not registered or registered but the DLL or EXE has a different version.

Try to add the same object to your project's references and create it by

Dim fs As Object
set fs = new Scripting.FileSystemObject


0
 

Author Comment

by:gre
ID: 1523168
Haven't tried that, I will, but I don't think it will work.

I think the issue is that it runs fine on my Dev box, but when it is installed
on a different machine, it can't find the activeX object, So I believe it is because
my project doesn't have a reference to the FileSystemObject.

The problem is that I am creating it dynamically, so when I create a DEP file
it only shows activeX dependencies for components I have manually included
into my project, but it cannot know that in my code I create a reference to an
activeX component.

anyway, I'll try your idea, thx
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 

Author Comment

by:gre
ID: 1523169
alex1234,

just saw your comment,

I know I need to add a reference, BUT WHICH ONE????
is  'Microsoft Scripting Runtime' the correct one????
I tried it and it didn't work.

I don't know what reference to check for the call I make
So how do I find out which reference to add for an object I dynamically create???
MSDN talks about the FileSystemObject, but doesn't say which reference to add,
and there is no 'FileSystemObject' in references


0
 
LVL 2

Expert Comment

by:jrmcg
ID: 1523170
On your target machine, check and make sure that the scrrun.dll file exists - if you haven't already.  I would have assumed that it would already be there but it's worth a shot.

J.R.
0
 

Author Comment

by:gre
ID: 1523171
scrrun.dll is on the target machine in system32.

How do we know scrrun.dll (which is the reference for Microsoft Scripting Runtime)
is the correct reference?

I think that is the wrong reference for what I am doing.
I think Microsoft Scripting Runtime is for asp scripting???

I need to find out what is the correct reference to add for using

Scripting.FileSystemObject

Obviously once I can figure that out, I think it will solve the problem.
thx
0
 
LVL 1

Expert Comment

by:alex1234
ID: 1523172
gre,

you said "I think the issue is that it runs fine on my Dev box, but when it is installed
on a different machine, it can't find the activeX object, So I believe it is because
my project doesn't have a reference to the FileSystemObject."

That means that your program runs successfuly on your machine but fails on others. Therefore scrrun.dll either not registered on other machines or has a different CLSID. Unregister scrrun.dll on these PCs and copy the one from yours and register if - this will fix the problem.

Also, you don't have to add a reference to scrrun.dll in your project - that was just a test to see if Scripting.FileSystemObject existed.


 
0
 
LVL 2

Expert Comment

by:tylerd
ID: 1523173
Add "OLE Automation" to your references
0
 

Author Comment

by:gre
ID: 1523174
alex1234
thx for your insight,

I'll try your idea

thx
0
 

Author Comment

by:gre
ID: 1523175
already have it checked
0
 

Author Comment

by:gre
ID: 1523176
alex1234,

I think you solved the problem.

Although scrrun.dll was on the target box, it had a timestamp of 1997,

the one on my Dev box has a timestamp of 1999.

I tried to unregister the old one, but it gave me an error,
so I just copied over the new one and registered it and it worked!

post an answer so I can give ya tha points.

thx,
Gre
0
 
LVL 1

Expert Comment

by:alex1234
ID: 1523177
gre, what are the results? Did it work?

0
 
LVL 1

Accepted Solution

by:
alex1234 earned 800 total points
ID: 1523178
You are getting this error because the object "Scripting.FileSystemObject" either doesn't exist (no DLL or EXE provided) or is not registered or registered but the DLL or EXE has a different version.

Try to add the same object to your project's references and create it by

Dim fs As Object
set fs = new Scripting.FileSystemObject

If it works unregister scrrun.dll on PCs where your program does not work and copy scrrun.dll from yours and register if - this will fix the problem.





0
 

Author Comment

by:gre
ID: 1523179
alex1234,

did ya see my last comment?

you solution worked,

the scrrun.dll on target machine was old.
I copied new sccrun.dll over and registered it and it WORKED!

thx,
post answer so I can give you the points,

thx again.
Gre
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

721 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