
View Message Thread (10 replies)
| Windows Script Host in Excel VBA |
 |
From: jasontferrell Date Posted: 11/2/2009 9:27:00 AM
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?

| RE: Windows Script Host in Excel VBA |
|
From: xp Date Posted: 11/2/2009 11:41:00 AM
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?
> .
>

| Re: Windows Script Host in Excel VBA |
|
From: jasontferrell Date Posted: 11/2/2009 12:49:00 PM
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.

| Re: Windows Script Host in Excel VBA |
|
From: JP Date Posted: 11/2/2009 12:51:00 PM
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 < jasontferr...@gmail.com> 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?

| Re: Windows Script Host in Excel VBA |
|
From: jasontferrell Date Posted: 11/2/2009 1:20:00 PM
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.

| Re: Windows Script Host in Excel VBA |
|
From: Dave Peterson Date Posted: 11/2/2009 2:43:00 PM
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

| Re: Windows Script Host in Excel VBA |
|
From: JP Date Posted: 11/2/2009 2:43:00 PM
Post more of your code?
--JP
On Nov 2, 3:15 pm, jasontferrell < jasontferr...@gmail.com> 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.

| Re: Windows Script Host in Excel VBA |
|
From: jasontferrell Date Posted: 11/3/2009 11:05:00 AM
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.

| Re: Windows Script Host in Excel VBA |
|
From: JP Date Posted: 11/3/2009 11:15:00 AM
How did you declare your variable? As Object or As FileSystemObject?
--JP
On Nov 3, 1:01 pm, jasontferrell < jasontferr...@gmail.com> 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.

| Re: Windows Script Host in Excel VBA |
|
From: jasontferrell Date Posted: 11/4/2009 12:44:00 PM

Would you like to track this thread?
By adding this News Thread to your Favorites Area you can refer to it later with just a click of the mouse.
Also you can optionally be notified instantly whenever there are any replies
posted to this Thread. To add this Thread to your Favorites Area just click on the red arrow next to the subject of the thread above
.
|