In the ApplicationProgramUsing the script engine can greatly enhance the flexibility and scalability of the program, similar to the macro functions of MS Office and vs. net. Microsoft. VSA. dll defines the Script Engine framework in the Microsoft. NET Framework, while Microsoft. visualbase. VSA. dll defines the script engine that implements VBA. You can use these two DLL to define your own Script Engine Based on VBA. net,
Microsoft. VSA. dll defines some framework interfaces. The important interfaces include
Ivsaengine is a script engine interface, which is used by all script engines.
Communication Interface of the ivsasite script engine. The script engine accepts this interface to publish some information.
Ivsaitem is a script engine resource project.
Ivsacodeitem is a scriptCodeModule
Ivsarefrenceitem is an external reference object used by the script engine.
Ivsaglobalitem is the global object module used by the script engine.
Generally, a script engine is instantiated to pass the ivsasite object to the script engine object. Then, reference, code text, and global objects are added using the createitem method of the engine items. call the compile method to compile the script engine and run it to start the engine.
After the script engine is started, an assembly is dynamically generated and loaded in the current application domain based on the script code, and the ivsaengine. assembly can be used to access the dynamically generated assembly.
Microsoft. visualbase. VSA. dll implements these interfaces and implements a script engine based on VBA. Net syntax.
The main object is vsaengine.
This program provides a C # written demo program, using Microsoft. net Framework 1.1. This demo program provides a general module using the script engine. You can use this module to conveniently use the VBA script engine to expand your applications.
Demo: http://files.cnblogs.com/xdesigner/VBAScriptDemo.rar