Invoke VBScript from VB.NET

Author Message
Mr.No

  • Total Posts : 7
  • Scores: 0
  • Reward points : 0
  • Joined: 11/18/2005
  • Status: offline
Invoke VBScript from VB.NET Friday, November 18, 2005 7:21 AM (permalink)
0
Hi

I classic VB6 you can place the script control on a form, load VBScript into it and excecute. You can also share objects between VB6 and VBScript. I want to achieve the same thing but with VB.NET. My objective is to write a VB.NET application that will run some queries against a database, build some object collections, load some  VBScript code and manipulate the object from VBScript. The objective is to have  configurable vbscripts to easily format the data from the object. Could someone point me to some links where I can learn soemthing about it.

Thanks
 
#1
    Drakesd

    • Total Posts : 1
    • Scores: 0
    • Reward points : 0
    • Joined: 1/27/2005
    • Location: Canada
    • Status: offline
    RE: Invoke VBScript from VB.NET Monday, December 12, 2005 7:44 AM (permalink)
    0
    Here is a good article by .Net Developers Journal that may help you:
    http://dotnet.sys-con.com/read/47761.htm
    Also, here is a site with a number of VB articles:
    http://www.findingfacts.com/L3/L3_2_28_33.php
     
    #2
      daluu

      • Total Posts : 53
      • Scores: 0
      • Reward points : 0
      • Joined: 4/17/2006
      • Status: offline
      RE: Invoke VBScript from VB.NET Thursday, May 21, 2009 12:30 PM (permalink)
      0
      I don't think you can share objects or code between VBScript and VB.NET unlike VB6.

      As for running VBScript from VB.NET, you could build your own control mechanism to have VB.NET execute the selected VBScript as an external process (or shell execute), and perhaps redirect I/O to the VB.NET app. Or otherwise embed/use ActiveX control in your VB.NET app via COM interop.
       
      #3
        TNO

        • Total Posts : 2094
        • Scores: 36
        • Reward points : 0
        • Joined: 12/18/2004
        • Location: Earth
        • Status: offline
        RE: Invoke VBScript from VB.NET Tuesday, May 26, 2009 3:08 AM (permalink)
        0
        To share VB.NET code with your VBScript, you have to expose your .NET code as a COM object.

        To run your VBScript code in .NET, its doable but generally not worth it. Turn off option strict, and just translate the code by hand since its pretty trivial going in that direction
        <message edited by TNO on Thursday, May 28, 2009 9:22 AM>
        To iterate is human, to recurse divine. -- L. Peter Deutsch
         
        #4
          ebgreen

          • Total Posts : 8227
          • Scores: 98
          • Reward points : 0
          • Joined: 7/12/2005
          • Status: offline
          RE: Invoke VBScript from VB.NET Tuesday, May 26, 2009 8:32 AM (permalink)
          0
          Or if you don't already have actual VBScript written, you could consider doing the script part in Powershell instead.
          "... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
          Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm
          http://www.visualbasicscript.com/m_47117/tm.htm
           
          #5

            Online Bookmarks Sharing: Share/Bookmark

            Jump to:

            Current active users

            There are 0 members and 1 guests.

            Icon Legend and Permission

            • New Messages
            • No New Messages
            • Hot Topic w/ New Messages
            • Hot Topic w/o New Messages
            • Locked w/ New Messages
            • Locked w/o New Messages
            • Read Message
            • Post New Thread
            • Reply to message
            • Post New Poll
            • Submit Vote
            • Post reward post
            • Delete my own posts
            • Delete my own threads
            • Rate post

            2000-2012 ASPPlayground.NET Forum Version 3.9