Solved

VB Automation error 8007007e

Posted on 2004-04-28
9
7,514 Views
Last Modified: 2012-05-04
Hi!

I have a problem with automation when trying to use a FileSystemObject. I run Windows XP with Office 2000 and the project is developed in Visual Basic 6.
When trying to execute the code below, I get this eror:

Run-time error '-2147024770 (8007007e)':
Automation error
The specified module could not be found.

----------------------------------
Private UserFileName As String
Private fso As New FileSystemObject

UserFileName = fso.GetSpecialFolder(WindowsFolder) + "\users.mdb"
----------------------------------

When I look at the FileSystemObject (fso) the Watch displays this message:
<Object variable or With block variable not set>

I have recently upgraded from Windows 2000 to Windows XP operating system. From what I read on the internet there might be an error with OLE Automation, but I don't know how to solve this. Everything worked just fine before I switched operating systems, and I also recall that everything worked fine in the beginning after Windows XP was installed (but I might be wrong on this point).

Can anyone give me a clue to what it could be, and how I should solve it?
0
Comment
Question by:tgauslaa
9 Comments
 
LVL 10

Expert Comment

by:anv
Comment Utility
add following line of code to the foem load event or b4 executing ur above statement...

set fso=createobject("scripting.FileSystemObject")

regards

anv
0
 
LVL 26

Expert Comment

by:EDDYKT
Comment Utility
Is any reason that you disable to allow run script from IE setting?
0
 
LVL 76

Accepted Solution

by:
David Lee earned 500 total points
Comment Utility
My guess is that Scrrun.dll isn't registered properly or something has happened to it.  I'd first try registering the dll again (i.e. regsvr32 C:\WINDIR\System32\Scrrun.dll ... replacing the Windows folder name on your system for WINDIR).  If that doesn't solve the problem, then I'd download and install Microsoft's scripting support from here:

http://www.microsoft.com/downloads/details.aspx?FamilyId=C717D943-7E4B-4622-86EB-95A22B832CAA&displaylang=en

It contains a copy of Scrrun.dll so if there's a problem with the version you currently have this one will verwrite and, hopefully, correct that.
0
 

Author Comment

by:tgauslaa
Comment Utility
Hi
It works again! I simply reinstalled Microsoft Visual Studio, and everything is back to normal.

The bad news is that I still don't know what caused it, except that I'm pretty sure that it didn't have anything to do with the code. I have a theory about how it happened, though. I think that something has either gone wrong when installing some new software on the computer (changed/deleted settings) or an error occurred that messed up one or more of the Automation dll's on the system. It may well be that it is the Scrrun.dll that messed things up, but unfortunately I had already fixed the problem by reinstalling VS6 before I saw your comment, BlueDevilFan, so I haven't been able to verify if your solution is correct. I'm just happy that everything is back to normal again. But I'm pretty sure you're right that it is one of the dll's that is either not registered or has an error. Thanks for your help!

Regards, tgauslaa.
0
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 
LVL 76

Expert Comment

by:David Lee
Comment Utility
I suspect that Visual Studio contains a copy of Scrrun.dll and that resintalling it accomplished the same thing as what I had proposed.  Either way it's fixed and that's the important thing.

Cheers.
0
 

Expert Comment

by:nneonneo
Comment Utility
THANK YOU!!

I had a ton of apps failing with "Automation Error" (3 to be exact...)
Running the regsvr on scrrun.dll FIXED THE PROBLEM!!
THANK YOU!!
0
 
LVL 76

Expert Comment

by:David Lee
Comment Utility
You're welcome, nneonneo.
0
 

Author Comment

by:tgauslaa
Comment Utility
It's nice that this thread can help more people.

Regards, tgauslaa.
0
 

Expert Comment

by:sitg
Comment Utility
-2147418105 (80010007) The callee (server [not server application]) in vb6
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…

762 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now