Hendra
Thanks for posting the solution. I, for one do not think VBScript questions are off-topic. After all, VBA is its kissing cousin. And since I own the group what I say goes. [grin]
As you found out, you have to qualify the CreateObject with WScript. That goes for other objects like FileSystemObject, too.
Ex:
Set fs = WScript.CreateObject("Scripting.FileSystemObject")
Regards,
Bill Mosca,
Founder, MS_Access_Professionals
That'll do IT <http://thatlldoit.com/> http://thatlldoit.com
MS Access MVP
<https://mvp.support.microsoft.com/profile/Bill.Mosca> https://mvp.support.microsoft.com/profile/Bill.Mosca
From: MS_Access_Professionals@yahoogroups.com [mailto:MS_Access_Professionals@yahoogroups.com] On Behalf Of Agestha Hendra
Sent: Sunday, June 24, 2012 5:53 AM
To: MS_Access_Professionals@yahoogroups.com
Subject: Bls: [MS_AccessPros] Almost Out Of Topic : Run Codes in VBScript (.vbs)
I was googling and found the answer :
Dim objShell
Set objShell = WScript.CreateObject("WScript.Shell")
objShell.Run("RUNDLL32.EXE URL.DLL,FileProtocolHandler " + "D:\NEW\SPP_IRT.doc")
Set objShell = Nothing
Sorry for the semi out of access topics,...
Regards
Hendra
________________________________
Dari: "agesthahendra@ymail.com <mailto:agesthahendra%40ymail.com> " <agesthahendra@ymail.com <mailto:agesthahendra%40ymail.com> >
Kepada: MS_Access_Professionals@yahoogroups.com <mailto:MS_Access_Professionals%40yahoogroups.com>
Dikirim: Minggu, 24 Juni 2012 16:15
Judul: [MS_AccessPros] Almost Out Of Topic : Run Codes in VBScript (.vbs)
Hi Everyone...
Maybe this is an semi out of access topic post, but i don't know where to ask this question., so any help would be really appreciated...
I have codes to run every file in our PC, it works in Access VBA,
but how can i run the codes in VBScript (.vbs)..??
here is the codes :
Private Sub Command4_Click()
Dim Fl As Long
Fl = Shell("RUNDLL32.EXE URL.DLL,FileProtocolHandler " & "D:\Sample\Test.mde", vbNormalFocus)
End Sub
Thank you for your attention,..
Regards
Hendra
[Non-text portions of this message have been removed]
[Non-text portions of this message have been removed]
Minggu, 24 Juni 2012
RE: [MS_AccessPros] Almost Out Of Topic : Run Codes in VBScript (.vbs)
__._,_.___
.
__,_._,___
Langganan:
Posting Komentar (Atom)
Tidak ada komentar:
Posting Komentar