Solved

Calling VBS from VB; unable to instantiate WSHController..

Posted on 2004-09-28
1
374 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 125 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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

758 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now