VBScript from VBA excel / wshShell.Run failed, error 80070483
Not O.K.
from any folder:
Tools Folder Options File Types
and then register .vbs with the Microsoft (r) Windows Based Script Host
--
Gary''s Student - gsnu200730
"rhXX" wrote:
On Jun 17, 3:37 pm, Gary''s Student
wrote:
Maybe its just the path:
Sub samples()
fn = "C:\hithere.vbs"
Set wshShell = CreateObject("Wscript.Shell")
wshShell.Run (fn)
End Sub
works just fine.
tks, but i think there is other problem
my sub is:
Sub bypass()
fn = "c:\tmp\bypass.vbs"
Set fso = CreateObject("Scripting.FileSystemObject")
Set fsoFile = fso.CreateTextFile(fn)
fsoFile.WriteLine "Set fso = CreateTextFile(""c:\tmp
\toto.txt"")"
fsoFile.WriteLine "fsoFile.WriteLine ""Hello world"""
fsoFile.WriteLine "fsoFile.Close"
fsoFile.Close
Set wshShell = CreateObject("Wscript.Shell")
wshShell.Run (fn)
End Sub
the bypass file was created ok:
Set fso = CreateTextFile("c:\tmp\toto.txt")
fsoFile.WriteLine "Hello world"
fsoFile.Close
the error is in the line
wshShell.Run (fn)
and the file toto.txt, wich must be created by the vbscript was not
created
question: when i try to run the vbscript by hand, it does not run
because .vbs extension is NOT associated by any application. is this
ok????
tks in advance
|