Dim sctest As ScriptControl Dim scode As String scode = " function OnProgramLoad() { window.open(""" & "http://www.google.co.uk/" & """, """ & "mywindow" & """); } " If Len(scode) < 1 Then Exit Sub If InStr(1, scode, "OnProgramLoad", vbTextCompare) = 0 Then Exit Sub Set sctest = New ScriptControl With sctest .Language = "JScript" .AllowUI = True .AddObject "Application", App .AddObject "Clipboard", Clipboard .AddObject "Printer", Printer .AddObject "Screen", Screen .AddCode scode .Run "OnProgramLoad" 'Error is thrown here End With Set sctest = Nothing
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)