var host = new ScriptControl(); host.Language = "VBScript"; var text = File.ReadAllText("TestScript.vbs"); host.AddCode(text); dynamic obj = host.Run("GetTestClass"); #### Can't locate public method Xyz() for System.__ComObject #### sub UseScriptControl { my ($self, $text) = @_; my $script = Win32::OLE->new('ScriptControl'); $script->{Language} = 'VBScript'; $script->AddCode($text); my $obj = $script->Run('GetTestClass'); $obj->Xyz(); } #### use strict; use Win32; use Win32::OLE::Variant; #### use PerlNET qw(typeof); typeof($obj)->InvokeMember("Xyz", PerlNET::enum("System.Reflection.BindingFlags.InvokeMethod"), PerlNET::null("System.Reflection.Binder"), $obj, "System.Object[]"->new());