Prism Visual Basic (VBA) commands.
Prism Windows (but not Mac) can be run using Visual Basic (VBA) commands. There is no Type Library (.tlb) file. With such a short list of commands, a .tlb file wouldn't be very helpful.
List of commands
- SetPath - set current directory (prarameter: path string) Details.
- Visible - makes Prism visible (no parameters)
- RunCommand - execute Prism script file (parameters: script file path string)
- Quit - exits Prism (no parameters) Details.
- Open - open file (parameters: prism file path string to open
Example
Set Prism = CreateObject("Prism.command")
Prism.SetPath ("C:\data\july99")
Prism.visible
Prism.runcommand ("c:\prism5\doseresp.pzc")
Prism.quit
Set Prism = Nothing
The first line creates a Prism command object. You may give the object variable any name you like (on the left side of the = sign), but it is convenient to name it Prism. You don't have to tell the program the location of prism.exe. Windows takes care of this automatically via the registry.
The second line, which is optional, tells Prism which folder to use. This replaces the need for a SetPath statement within the Prism script. When running a script, Prism looks for data files and templates in this directory (folder) first. Place the name of the folder in quotation marks or use a text variable.
The third line tells Prism to show its progress dialog. Once you have tested your code, remove this line so Prism will run invisibly (show no dialogs).
The fourth line launches the Prism script. You must include the full path of the script file; the directory used in the SetPath message (above) is not used automatically.
The final two lines cause Prism to exit, and free the memory used by the Prism object.
What happens when you have two versions of Prism on your computer
If you launch Prism via VBA and you have two (or more) versions of Prism installed, then Windows decides which one to launch. It decides based on registry entries. Whenever Prism launches, it tries to update the registry to make that version of Prism be the default. If you run Prism with admin rights, this always works. If you run Prism without admin rights, then the registry changes may not stick.