Visual Studio Developer Center > Visual Basic Forums > Visual Basic Language > VBScript & VS2005: Specified cast is not valid

Unanswered VBScript & VS2005: Specified cast is not valid

  • Friday, October 21, 2005 11:46 AM
     
     
    hi, this code, thar runs ok on Vs2003, don´t run on VS2005 :

    script.Language = "VBScript"

    script.AddObject("Form1", Me, True)

    On Visual Studio 2005 using Microsoft Script Control this code returns: Specified cast is not valid

    I've tried:
       script.AddObject("Form1",ctype(Me,Form),True)
       script.AddObject("Form1",ctype(sender,Form),True) (on form_load)
       script.AddObject("Form1",sender,True)


    Any ideas???
    Thanks

All Replies

  • Friday, October 21, 2005 3:12 PM
     
     
    There might be an option to set Option String to Off. And what is the definition of AddObject ?