I want to use the xshell library in vbscript , but when I used createObject() to create object it failed, how could I create an Object from the type library provided by the Xshell application?
The xshell could be registered to system well, I guess, because I can add a reference in the excel vba project by 'tools->reference->"Xshell 1.0 Type Library", then I can use dim xshell as xshell.ScriptHost and I can find the Xshell info from the object browser.
I have tried oleviwer to find some information about the Xshell 1.0 Type Library, but actually I can't find the ProgID of xshell.
I turn to exeScope ,and do i find something interesting
in the right window we can see "ForceRemove {xxxx-xxxxxxxx-xxxx} = s'ScriptHost Class ....{ProgID=s'Xshell.ScriptHost.1'.... ForceRemove 'Programmable' ....}
how could i cancel the force remove ?
dim xshell
set xshell=CreateObject("C:\Program Files (x86)\Common Files\NetSarang\XshellCore.tlb")
MsgBox "success"
run error with error code "800A01AD"
ActiveX component could not create object
You cannot create a COM component instance from a Type Library. The Type Library is a definition file that describes the Objects, Properties and Methods a COM Object Library supports be it using the
IUnknown
orIDispatch
interfaces.It is simply a definition file and does not contain any implementation. If you want to try and use XShell using VBScript you need to locate the COM DLL associated with the application.
If XShell is exposed to COM it will have registered a ProgID in the Windows Registry. If you can find the ProgID in the registry using tools like
regedit.exe
you could use the following check list to identify the DLL associated with it and use theProgID
withCreateObject()
to instantiate an instance of the COM component.