Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 56
Default Windows Script Host in Excel VBA

This is not technically an Excel object, but I'm having a problem with
it within a workbook. I have some code that calls the
FileSystemObject in a workbook that works fine on my machine, but does
not work on a colleague's machine, which appears to be identical (same
OS, Excel Version 2003).
The code fails on a line like this:
Set fso=New FileSystemObject
or set fso=CreateObject("Scripting.FileSystemObject")
The error is Automation Error The specified module could not be found.
If I go to Tools-References on the problem machine, it doesn't show
any missing referenced files. Also, if I go to the Object Browser and
search for filesystemobject, it finds it. Intellisense similarly can
look up the object. However, I get this error indicating that it
cannot find the FileSystemObject. What should I try next?
  #2   Report Post  
Posted to microsoft.public.excel.programming
XP XP is offline
external usenet poster
 
Posts: 389
Default Windows Script Host in Excel VBA

Try this: get each of your macro names and search for each one, one at a
time, throughout all modules. I have gotten this error before, because I had
two Subs or Functions with the same name in different modules...

Hope it helps.

"jasontferrell" wrote:

This is not technically an Excel object, but I'm having a problem with
it within a workbook. I have some code that calls the
FileSystemObject in a workbook that works fine on my machine, but does
not work on a colleague's machine, which appears to be identical (same
OS, Excel Version 2003).
The code fails on a line like this:
Set fso=New FileSystemObject
or set fso=CreateObject("Scripting.FileSystemObject")
The error is Automation Error The specified module could not be found.
If I go to Tools-References on the problem machine, it doesn't show
any missing referenced files. Also, if I go to the Object Browser and
search for filesystemobject, it finds it. Intellisense similarly can
look up the object. However, I get this error indicating that it
cannot find the FileSystemObject. What should I try next?
.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 56
Default Windows Script Host in Excel VBA

Okay, I checked that, and ensured I'm not using the same name, even in
Private subroutines within different modules. It is working on one
machine, just not the other one.
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 897
Default Windows Script Host in Excel VBA

Have you tried setting a reference to Windows Script Host Object
Model?

In the VBA IDE (press Alt-F11), go to Tools References and look for
"Windows Script Host Object Model". If you can't find it, click Browse
and go to the system32 folder and look for wshom.ocx. Did you find it?

--JP

On Nov 2, 11:24*am, jasontferrell wrote:
This is not technically an Excel object, but I'm having a problem with
it within a workbook. *I have some code that calls the
FileSystemObject in a workbook that works fine on my machine, but does
not work on a colleague's machine, which appears to be identical (same
OS, Excel Version 2003).
The code fails on a line like this:
Set fso=New FileSystemObject
or set fso=CreateObject("Scripting.FileSystemObject")
The error is Automation Error The specified module could not be found.
If I go to Tools-References on the problem machine, it doesn't show
any missing referenced files. *Also, if I go to the Object Browser and
search for filesystemobject, it finds it. *Intellisense similarly can
look up the object. *However, I get this error indicating that it
cannot find the FileSystemObject. *What should I try next?


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 56
Default Windows Script Host in Excel VBA

Yes, I have a reference to the Windows Script Host Object Model. I
also disconnected and reconnected it on the machine that's having a
problem.


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 897
Default Windows Script Host in Excel VBA

Post more of your code?

--JP

On Nov 2, 3:15*pm, jasontferrell wrote:
Yes, I have a reference to the Windows Script Host Object Model. *I
also disconnected and reconnected it on the machine that's having a
problem.

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Windows Script Host in Excel VBA

I remember when this kind of scripting came out.

Our IT folks disabled them from running. They were afraid of security/malware
problems.

Maybe your user disabled scripting?

Can you run a .vbs file by double clicking on it?

jasontferrell wrote:

This is not technically an Excel object, but I'm having a problem with
it within a workbook. I have some code that calls the
FileSystemObject in a workbook that works fine on my machine, but does
not work on a colleague's machine, which appears to be identical (same
OS, Excel Version 2003).
The code fails on a line like this:
Set fso=New FileSystemObject
or set fso=CreateObject("Scripting.FileSystemObject")
The error is Automation Error The specified module could not be found.
If I go to Tools-References on the problem machine, it doesn't show
any missing referenced files. Also, if I go to the Object Browser and
search for filesystemobject, it finds it. Intellisense similarly can
look up the object. However, I get this error indicating that it
cannot find the FileSystemObject. What should I try next?


--

Dave Peterson
  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 56
Default Windows Script Host in Excel VBA

Thanks very much for all the help. It turned out that the machine
where I did the coding was on Windows Script Host Object Model 5.7 and
the machine where it didn't work was on 5.6. Upgrading to 5.7 appears
to have solved the problem.
  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 897
Default Windows Script Host in Excel VBA

How did you declare your variable? As Object or As FileSystemObject?

--JP

On Nov 3, 1:01*pm, jasontferrell wrote:
Thanks very much for all the help. *It turned out that the machine
where I did the coding was on Windows Script Host Object Model 5.7 and
the machine where it didn't work was on 5.6. *Upgrading to 5.7 appears
to have solved the problem.


  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 56
Default Windows Script Host in Excel VBA

As FileSystemObject


  #11   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 897
Default Windows Script Host in Excel VBA

If you declared it As Object in the first place (late binding), the
version dependency issue probably wouldn't have occurred.

--JP

On Nov 4, 2:39*pm, jasontferrell wrote:
As FileSystemObject


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Windows Scripting Host popup method has stopped timing out Curt[_2_] Excel Programming 2 February 15th 07 06:39 PM
Can we run Windows Script file from Excel/Office Application Dave Peterson Excel Programming 0 December 29th 06 02:46 PM
Pass a variable back to the host script? mb Excel Programming 2 October 29th 05 07:02 PM
Windows Scripting Host/Windows XP V. Roe Excel Programming 0 May 13th 04 02:06 PM
Use Windows Script to run Windows Explorer Search? Ian Elliott[_3_] Excel Programming 0 January 12th 04 05:03 PM


All times are GMT +1. The time now is 11:49 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"