Discussion:
WScript.Shell
(too old to reply)
d***@gmail.com
2006-10-11 08:01:54 UTC
Permalink
Hi,

My question is simple: I have to use the WScript.Shell object from VBA
(Excel 2000), but i want to use early-binding (instead of
late-binding--> CreateObject("WScript.Shell")).

I'm unable to find out what reference I must to set in the VBA editor
in order to use that object.

Thank you beforehand.
ekkehard.horner
2006-10-11 08:44:54 UTC
Permalink
Post by d***@gmail.com
Hi,
My question is simple: I have to use the WScript.Shell object from VBA
(Excel 2000), but i want to use early-binding (instead of
late-binding--> CreateObject("WScript.Shell")).
I'm unable to find out what reference I must to set in the VBA editor
in order to use that object.
Thank you beforehand.
Windows Script Host Object Model / wshom.ocx
d***@gmail.com
2006-10-11 09:36:27 UTC
Permalink
Post by ekkehard.horner
Post by d***@gmail.com
Hi,
My question is simple: I have to use the WScript.Shell object from VBA
(Excel 2000), but i want to use early-binding (instead of
late-binding--> CreateObject("WScript.Shell")).
I'm unable to find out what reference I must to set in the VBA editor
in order to use that object.
Thank you beforehand.
Windows Script Host Object Model / wshom.ocx
Thanks for replying, but I've just added that reference and still
doesn't not compile.
Joe Fawcett
2006-10-11 11:59:28 UTC
Permalink
What do your DIM and SET statements look like?
--
Joe Fawcett (MVP)

http://joe.fawcett.name
Post by d***@gmail.com
Post by ekkehard.horner
Post by d***@gmail.com
Hi,
My question is simple: I have to use the WScript.Shell object from VBA
(Excel 2000), but i want to use early-binding (instead of
late-binding--> CreateObject("WScript.Shell")).
I'm unable to find out what reference I must to set in the VBA editor
in order to use that object.
Thank you beforehand.
Windows Script Host Object Model / wshom.ocx
Thanks for replying, but I've just added that reference and still
doesn't not compile.
d***@gmail.com
2006-10-11 12:57:32 UTC
Permalink
The statements are correct. The one and only problem is that the
library that defines the type is not loaded.

Anyway these are my statements:

Dim wsh As WScript.Shell
Set wsh = new WScript.Shell
Post by Joe Fawcett
What do your DIM and SET statements look like?
--
Joe Fawcett (MVP)
http://joe.fawcett.name
Post by d***@gmail.com
Post by ekkehard.horner
Post by d***@gmail.com
Hi,
My question is simple: I have to use the WScript.Shell object from VBA
(Excel 2000), but i want to use early-binding (instead of
late-binding--> CreateObject("WScript.Shell")).
I'm unable to find out what reference I must to set in the VBA editor
in order to use that object.
Thank you beforehand.
Windows Script Host Object Model / wshom.ocx
Thanks for replying, but I've just added that reference and still
doesn't not compile.- Hide quoted text -- Show quoted text -
ekkehard.horner
2006-10-11 12:54:15 UTC
Permalink
Post by d***@gmail.com
Post by ekkehard.horner
Post by d***@gmail.com
Hi,
My question is simple: I have to use the WScript.Shell object from VBA
(Excel 2000), but i want to use early-binding (instead of
late-binding--> CreateObject("WScript.Shell")).
I'm unable to find out what reference I must to set in the VBA editor
in order to use that object.
Thank you beforehand.
Windows Script Host Object Model / wshom.ocx
Thanks for replying, but I've just added that reference and still
doesn't not compile.
My apologies, but I just verified again, that

Sub test()
Dim oWSH As New WshShell
MsgBox oWSH.CurrentDirectory
End Sub

compiles/runs if and only if I add the reference to
Windows Script Host Object Model / wshom.ocx

Perhaps I misunderstood your requirement?
d***@gmail.com
2006-10-11 13:13:16 UTC
Permalink
Yes, I've just verified that also, but you used "WshShell" instead of
"WScript.Shell".

Are they the same object?
Post by ekkehard.horner
Post by d***@gmail.com
Post by ekkehard.horner
Post by d***@gmail.com
Hi,
My question is simple: I have to use the WScript.Shell object from VBA
(Excel 2000), but i want to use early-binding (instead of
late-binding--> CreateObject("WScript.Shell")).
I'm unable to find out what reference I must to set in the VBA editor
in order to use that object.
Thank you beforehand.
Windows Script Host Object Model / wshom.ocx
Thanks for replying, but I've just added that reference and still
doesn't not compile.My apologies, but I just verified again, that
Sub test()
Dim oWSH As New WshShell
MsgBox oWSH.CurrentDirectory
End Sub
compiles/runs if and only if I add the reference to
Windows Script Host Object Model / wshom.ocx
Perhaps I misunderstood your requirement?- Hide quoted text -- Show quoted text -
ekkehard.horner
2006-10-11 15:29:32 UTC
Permalink
Post by d***@gmail.com
Yes, I've just verified that also, but you used "WshShell" instead of
"WScript.Shell".
Are they the same object?
Yes

Continue reading on narkive:
Loading...