?
Solved

ActiveX component/reference for FileSystemObject??

Posted on 1999-07-09
14
Medium Priority
?
565 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
  • 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
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.

 

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

Receive 1:1 tech help

Solve your biggest tech problems alongside global tech experts with 1:1 help.

Question has a verified solution.

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

Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…
Suggested Courses
Course of the Month5 days, 17 hours left to enroll

588 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