Questions tagged [scriptcontrol]
42 questions
25
votes
6 answers
Excel VBA: Parsed JSON Object Loop
Per example below...Looping through an object from a parsed JSON string returns an error "Object doesn't support this property or method". Could anyone advise how to make this work? Much appreciated (I spent 6 hours looking for an answer before…

rr789
- 619
- 2
- 8
- 10
11
votes
3 answers
Getting ScriptControl to work with Excel 2010 x64
I am trying to use the solution given to this, however, whenever I try to run the most basic anything, I get an Object not Defined error. I thought this would be my fault (not having installed ScriptControl). However, I tried installing as described…

Proto
- 147
- 1
- 1
- 7
7
votes
2 answers
JScriptTypeInfo definition
I have the following code in VBScript:
Dim control
set control = CreateObject("MSScriptControl.ScriptControl")
control.language = "jscript"
control.addCode("function test() { return {property: 'test'}; };")
Dim result
set result =…
user69820
3
votes
1 answer
How to Implement An Event in Microsoft Script Control?
All docs i've read on MSScriptControl say that it can respond to events of objects added to it.
the script control allows you to write script that will automatically
fire when an event on an object occurs.
…

johny why
- 2,047
- 7
- 27
- 52
2
votes
0 answers
Why does querySelectorAll return an object that is JScriptTypeInfo, which can then be treated as a string, instead of a nodeList?
Whilst answering this question I noted some odd, to me, behaviour. In the code from that answer, shown below, I was expecting the variables names to be a static nodeList: Object\DispStaticNodeList. This is the usual return for querySelectorAll with…

QHarr
- 83,427
- 12
- 54
- 101
2
votes
3 answers
Evaluating dynamic string formulas in .NET?
I'm working on a project where I need to evaluate some formulas in VB.NET. I've been using the MS Script Control to evaluate some of the simple logical/mathematical formulas.
However, I'm now faced with dealing with string expressions that set…

Overhed
- 1,289
- 1
- 13
- 41
2
votes
3 answers
Ensuring unique ID attribute for elements within ScriptControl
I'm creating a control based on ScriptControl, and I'm overriding the Render method like this:
protected override void Render(HtmlTextWriter writer)
{
RenderBeginTag(writer);
writer.RenderBeginTag(HtmlTextWriterTag.Div);
…

Andy West
- 12,302
- 4
- 34
- 52
2
votes
1 answer
Scriptcontrol - bind client & server properties
Is it possible to bind properties on the client and server side in Scriptcontrol, so when I set property in javascript, change will be visible also in code behind and when I set property in code behind, change will be visible in javascript?
I can't…

mrzepa
- 635
- 7
- 17
1
vote
0 answers
ScriptControl seems to block UI thread
I'm currently writing an application in C# and would like to allow external VB scripts to manipulate the WPF based GUI of the application in some way. Those scripts should be allowed to run very long and to pause the thread they are running in (it's…

Gene
- 4,192
- 5
- 32
- 56
1
vote
1 answer
Error when try to use "ScriptControl" from "MSScriptControl" in VbsScript
I trying to run this code:
Dim jsonString, jsonDictionary
jsonString = "{ ""name"": ""John"", ""age"": 30, ""city"": ""New York"" }"
Set jsonDictionary = JSONToDictionary(jsonString)
MsgBox(jsonDictionary.Item("name")) ' ->…

Jaime Hernandez
- 11
- 2
1
vote
2 answers
Is it possible to sleep in JScript executed by C# MSScriptControl.ScriptControlClass?
I'd like to be able to sleep in a JScript executed by C# MSScriptControl.ScriptControlClass. I thought that maybe the WScript.Sleep() function might be available, but I'm getting a "WScript is undefined" error message when trying that. I'm new to…

user846423
- 13
- 2
1
vote
0 answers
Evaluating a string containing VBA code in MS Word and Getting ScriptControl to work
My goal is to generate strings that contain code to be evaluated for a given set of variables. I found some similar efforts in these questions:
VBA execute code in string
How can I evaluate a string into an object in VBA?
Because in the code…

GMCB
- 187
- 2
- 15
1
vote
2 answers
Creating an AJAX Script Control
Call me a 'n00b', but I am new to creating Script Controls. I want to create a simple control with 3 text boxes. I have a .cs file that looks like this:
public class SmokingCalc : ScriptControl
{
public SmokingCalc()
{
…

BBetances
- 925
- 1
- 14
- 23
1
vote
1 answer
Remove layers (keys) from heavily nested JSON in JSCRIPT/VBA
I am parsing a heavily nested JSON in VBA, using scriptcontrol/jscript.
The resulting JSON object is super nested, and has recurring 'useless' levels / layers called 'buckets'.
Is there a way I can remove these collectively from either my json…

JasperD
- 152
- 1
- 3
- 15
1
vote
1 answer
Javascript/Ajax - Manually remove event handler from a Sys.EventHandlerList()
I have two script controls, one holds the other, and I have successfully been able to handle events from the child on the parent using:
initialize: function()
{
this._autoComplete = $get(this._autoCompleteID);
this._onAutoCompleteSelected…

Programmin Tool
- 6,507
- 11
- 50
- 68