M
mcnewsxp
what reference do i need to check to make this work?
Dim WSH As New WSHNetwork
Dim WSH As New WSHNetwork
But why do you want it? What are you trying to do? There may be better
ways.
not sure.
it's another one of those inherited systems.
i get an error message when i try to complie the code is the only
reason. i'm on a budget and deadline so i don't have time to fish
around.
David W. Fenton said:not sure.
it's another one of those inherited systems.
i get an error message when i try to complie the code is the only
reason. i'm on a budget and deadline so i don't have time to fish
around.
You can almost always replace a reference (early binding) with late
binding and use Object variable types. Here's an example:
Dim objFSO As Object
Set objFSO = CreateObject("Scripting.FileSystemObject")
If objFSO.FolderExists("\\d9m09521\WB\") Then
[etc.]
In that case, I'm able to use the .FolderExists method of the File
System Object without needing to have a reference to it.
Douglas J. Steele said:David W. Fenton said:Windows Script Host Object Model.
But why do you want it? What are you trying to do? There may be
better ways.
not sure.
it's another one of those inherited systems.
i get an error message when i try to complie the code is the only
reason. i'm on a budget and deadline so i don't have time to fish
around.
You can almost always replace a reference (early binding) with late
binding and use Object variable types. Here's an example:
Dim objFSO As Object
Set objFSO = CreateObject("Scripting.FileSystemObject")
If objFSO.FolderExists("\\d9m09521\WB\") Then
[etc.]
In that case, I'm able to use the .FolderExists method of the File
System Object without needing to have a reference to it.
Do you happen to know how to late bind WSH David? You need to add a
reference to Windows Script Host Object Model
(C:\Windows\System32\wshom.ocx). That shows up in the Object Browser
as IWshRuntimeLibrary
I would have expected that would result in
Set wshObj = CreateObject("IWshRuntimeLibrary.WSHNetwork")
working, but it doesn't.
RoyVidar said:Try through WScript
Set wshObj = CreateObject("WScript.Network")
[]
You can almost always replace a reference (early binding) with
late binding and use Object variable types. Here's an example:
Dim objFSO As Object
Set objFSO = CreateObject("Scripting.FileSystemObject")
If objFSO.FolderExists("\\d9m09521\WB\") Then
[etc.]
In that case, I'm able to use the .FolderExists method of the
File System Object without needing to have a reference to it.
Do you happen to know how to late bind WSH David?
You need to add a
reference to Windows Script Host Object Model
(C:\Windows\System32\wshom.ocx). That shows up in the Object
Browser as IWshRuntimeLibrary
I would have expected that would result in
Set wshObj = CreateObject("IWshRuntimeLibrary.WSHNetwork")
working, but it doesn't.