Problem creating a filesystem object

  • Thread starter Thread starter John Crawford
  • Start date Start date
J

John Crawford

I created a presentation 'first slide' that can display shapes
and/or pictures randomly on the screen. It can also show a random
background picture and play either a single wav (song) file or a cd.
The options selected are determined by a control file.
This was created in Office 2000 on a Windows me machine. It worked
for about 2 years without a problem. I have migrated to xp, and now it
does not work. It fails at the line:

Set fs = CreateObject("Scripting.FileSystemObject")

with the message:

"Automation error. The specified module could not be found."

Can anyone give me some direction as to what is causing the problem.

Thanks in advance
John Crawford
 
Probably, PowerPoint is not able to resolve reference to Microsoft Scripting
Runtime. Check that the reference is still present:
1. In PowerPoint VBA Editor, select "Tools" | "References..." menu item.
2. Ensure that "Microsoft Scripting Runtime" item is checked.

If you don't find "Microsoft Scripting Runtime" item there, do the
following:
1. In the same References dialog box, click "Browse..." button.
2. The "Add Reference" dialog box normally opens in Windows System directory
and that is what we want.
3. Locate and select "scrrun.dll" in Windows System directory.
4. Click Open button after selecting scrrun.dll.
5. Click OK in the "References" dialog box.

See if your code now runs.

- Chirag

PowerShow - View multiple PowerPoint slide shows simultaneously
http://officeone.mvps.org/powershow/powershow.html
 
Chirag:
Thanks. The reference was not set. So I set it. Same result. However
I did try the same presentation on another machine with basically the
same setup, and it worked!!
I hate it when it is something local in my machine, especially when
it involves probably trying to get it resolved through Microsoft. If you
have anything else that I could check I would appreciate it. The error
number returned is -2147024770.
Thanks again for getting me at least this far.
John
 
Is it possible that scripting is disabled on your computer as a security
measure? I believe you can do this somehow.

Also, are you doing anything complex with the control file?
From what I've seen, the FSO doesn't seem to have many, if any, features that
you can't replicate in a few lines of VB code (and by doing that, you free
yourself of dependencies on the FSO)
 
Chirag:
The two xp machines are both at the same Windows level. One is Dell
and one Toshiba. Both machines have Office 2000 professional, at the
same level. Both are running AVG at the same level.
One other thing that I noticed is that the presentation came from
Windows me. Again it had Windows 2000 professional. However the
scripting runtime was not checked on that version (as can been seen by
the fact that I brought the presentation over intact).

Steve:
I will try to find some way on the machine of disabling scripting.
What I am trying to do is open an ascii file and read the contents
to set up the parameters for the startup. Basically I am just trying to
process an input file. When I first started down this road, I could not
find a VBA method to do this in PP. I asked this forum, and the response
was FSO. If there is an easier/better way I am all for it.

Thanks to both of you.
John
 
Steve:
I will try to find some way on the machine of disabling scripting.
What I am trying to do is open an ascii file and read the contents
to set up the parameters for the startup. Basically I am just trying to
process an input file. When I first started down this road, I could not
find a VBA method to do this in PP. I asked this forum, and the response
was FSO. If there is an easier/better way I am all for it.

I just added this page ... have a look and see if it suits:

Use VBA to read text from a file
http://www.pptfaq.com/FAQ00913.htm
 
Steve:
Actually, after I read your previous note I thought to re-look at
the problem again. Yes VBA dors have an open, and line input functions.
So I now read the file as I do in all other vb programs, and it works fine.
I cannot find the original question that got me to the
FileSystemObject solution.
Thanks.
John
 
Steve:
Actually, after I read your previous note I thought to re-look at
the problem again. Yes VBA dors have an open, and line input functions.
So I now read the file as I do in all other vb programs, and it works fine.
I cannot find the original question that got me to the
FileSystemObject solution.

No matter ... you've now found your way to Truth, Enlightenment and Freedom
from Technology of the Week. <g>
 
Back
Top