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)
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
|
|
|
|
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)
|
|
|
|
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)
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.
|
|
|
|
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)
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
|
|
|
|
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)
Or if you don't already have actual VBScript written, you could consider doing the script part in Powershell instead.
|
|
|
|