Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Calling VBS from VB; unable to instantiate WSHController..

Posted on 2004-09-28
1
Medium Priority
?
382 Views
Last Modified: 2012-06-21
Hi,

  I need to call a vbscript from my VB application.
The code is as follows. It builds, but gives a run time error for WSHController ( Run time error '429' : Active X component can't create object.)

/***************/
Dim Controller, RemoteScript
Set Controller = CreateObject("WSHController")
Set RemoteScript = Controller.CreateScript("C:\dummy1\testchat\winsock1\server\mapping.vbs")
RemoteScript.Execute
/*********/

Why does this happen? Should I register some DLLs? Which DLL is required for WSHController to work?
When I try to register wscript with 'wscript - regserver', I get an error "Unknown option '-' specified"

Please suggest a solution.
Regards,
 ink
0
Comment
Question by:ink777
1 Comment
 
LVL 31

Accepted Solution

by:
merowinger earned 375 total points
ID: 12177529
why dont call it with wshshell???

dim wshshell
set wshshell = CreateObject("Wscript.Shell")
wshshell.run ("C:\dummy1\testchat\winsock1\server\mapping.vbs")


mero
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

885 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question