Dynamically Set ActiveX Script At Runtime

  • I have an ActiveX Script Task in my package that is being used to execute some legacy code. However, the code accepts parameters that change with each execution.

    Using variables I am writing the script out each time to a vbs file and then using the ActiveX Script Task to execute the file. Although I can change the code that is being executed in this manner what I cannot work out how to do is change the script that the ActiveX Script Task is using.

    What I need to be able to do is change the Script value of the task each time.

    Does anyone know how to do this?

     

    Thanks

  • Not really an answer to your question (because I don't use ActiveX script task)

    The ActiveX component is depreciated. Why not change the code to use the script component which is VB.net and has better integration.

    Cheers,CrispinI can't die, there are too many people who still have to meet me!It's not a bug, SQL just misunderstood me!

  • Hi Crispin,

    Ideally that is what I would do but unfortunately the code has to create an instance of a COM object that was supplied by a third party. As far as I can tell, the Script Task will not allow me to add a reference to COM objects and so therefore I cannot create it.

     

  • unfortunately this is true - you cant add a reference to the script tasks without some pretty nasty hacks -

    According to technet:

  • If the task will use custom .NET assemblies or COM interop, you should create a custom object. The Add Reference dialog box in the script development environment does not support browsing to locate and reference custom assemblies, and does not let you reference COM components.

    http://technet.microsoft.com/en-us/library/ms135925.aspx


  • Kindest Regards,

    Catherine Eibner
    cybner.com.au

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply