Questions tagged [msscriptcontrol]

The MS Script Control is an ActiveX control by Microsoft that is used to provide general-purpose scripting services within an application. The MS Script Control supports both VBScript and JavaScript scripting languages.

32 questions
0
votes
2 answers

MSScriptControl Issue on Windows Server 2008

So I'm using the MSScriptControl to run some javascript in my app and I want to be able to get some information about any errors the script may cause. MSScriptControl.ScriptControlClass script = new MSScriptControl.ScriptControlClass(); try { …
Spencer Ruport
  • 34,865
  • 12
  • 85
  • 147
0
votes
0 answers

Is it possible to replace ScriptControl in VBA to another valid object?

I am running a macro which is using ScriptControl and parsing data with JSON. Now I need to get rid of ScriptControl due the security policies in the company. Microsoft is not updating ScriptControl anymore and to run the macro I need to install one…
0
votes
1 answer

Using MSscriptControl in VB.net adding an object gives Specified cast is not valid error

Here a sample code that produces the error. I have used MSscript in VB projects in the past and those projects are functioning. The error reported is: "When casting from a number, the value must be a number less than infinity" Or if anyone has…
0
votes
1 answer

64 bit Excel VBA to call a JavaScript function

I need to use a VBA ScriptControl object to call a JavaScript function , but it gave me a "Class Not Registered" error. I have added Microsoft Script Control 1.0 from Tools->References I need to call JavaScript to get a JSON object from this Rest…
Sachu
  • 191
  • 1
  • 4
  • 15
0
votes
1 answer

Redefine a class or function

I have to add a VBScript interface to our C# app and have completed this with ScriptControlClass (MS Scripting Engine). However, I am not too familiar with VBS and can't find a solution to this: If I define a class then decide to make a change to…
001
  • 13,291
  • 5
  • 35
  • 66
0
votes
1 answer

VB.NET Evaluate a string with variables

I like to populate my database with different formulas. When I have a formula in the database like "(2+4)*5" I get the result 40: update DB.dbo.INFOGROUP SET formula = '(2+4)*5' where INFOGROUP = 'S42' When I have a formula in the database like…
Miguel Terlaak
  • 175
  • 1
  • 13
0
votes
1 answer

VB Script with reference script is not working in ScriptControl c#

Hi I am executing a VB script using script control in c#. If it is a standalone script then it works fine for me by using the below code. ScriptControl SC = new ScriptControl(); SC.Language = ScriptType; …
Dah Sra
  • 4,107
  • 3
  • 30
  • 69
0
votes
1 answer

using CDO.message.HTMLBody within MSScriptControl.ScriptControl object

In a c-ish language, I was instantiating a MSScriptControl.ScriptControl object and using the .AddCode method to run VBScript, which in turn, instantiated the CDO.Message object. However, every time I got to the "objMsg.HTMLBody = \"" + email_body…
Keith
  • 777
  • 8
  • 27
0
votes
0 answers

Passing VB6 classes from dll to vb script through c#.net

I have a dll containing VB6 classes (.cls files). I have a VB script that uses these classes. I have a C#.Net program that runs the script using Microsoft Script Control library (Ref:…
Rashmi Pandit
  • 23,230
  • 17
  • 71
  • 111
0
votes
1 answer

What can't I use when UseSafeSubset is true?

When I use an MSScriptControl in VB6, and set UseSafeSubset = True, what kind of things can't I do? I mean, what Controls can't I use? Or maybe some core Objects can't be instantiated or used? Maybe I can't CRUD files? I need a definitive list,…
StorymasterQ
  • 264
  • 2
  • 17
0
votes
0 answers

How to check if a Script defines a particular Class or Property using MSScriptControl?

I'm currently idiot-proofing a legacy VB6 program that uses an MSScriptControl. It takes a file name as input, then gets some strings defined in a Property of a Class defined in said file. Here's the current code: Dim oScript As New…
StorymasterQ
  • 264
  • 2
  • 17
0
votes
1 answer

How to import a DLL to MSScriptControl.ScriptControl

I have a query on the MS Script Control, I have an VB6 Program that uses the MSScript control to allow users to write Macros inside the application. My question is how to import a DLL to object of type MSScriptControl.ScriptControl.
0
votes
1 answer

How can we programmatically know the syntax error using msscript.ocx?

I have implemented msscript.ocx using c# and it works for VBScript. Consider the following VBScript code: For i = 0 To 5 'The following line has missing 'Then'. It should show an error. If i = 2 Exit For End If Next How can we tell if…
Jaskaran
  • 320
  • 5
  • 19
0
votes
1 answer

Debug VBScript from MSScriptControl.ScriptControlClass, Change DefaultAppPool registry

I have ASP.NET application where I use MSScriptControl.ScriptControlClass to execute VBScripts. However, breakpoints ('stop') are ignored when Eval() function runs the script. I'd like to see JITDebugger triggered, which would allow me to use…
0
votes
1 answer

Visual Basic ScriptControl won't write to variable?

I'm trying to make a (very simple) graphing calculator in Visual Basic, and I used ScriptControl so that the user can input their own equation and it'll use eval() to get the result. Public Class Form1 Dim sc As MSScriptControl.ScriptControl =…
nbura
  • 368
  • 3
  • 15