![]() |
| |||||||
Workspace Macro Pro - Automation Edition Post messages and questions related to Macro Software for Windows Automation here. |
![]() |
| | LinkBack | Thread Tools | Display Modes |
| |||
| When I enter the following code to produce a VB Studio 2005 application *************** Public Class Form1 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Call Macro1() End Sub Sub Macro1() retval = Shell("C:\Program Files\Workspace Macro Pro 6.5\My Macros\Ed.wksp") End Sub End Class **************** This is a simple one button test form in VB Studio 2005 to run a workspace macro, but it gives me an error "Name 'retval' is not declared " and I do not know how to declare it and clear this error in order for the vb form to run my macro Ed.wksp. |
| |||
| Hello, Here is the syntax for declaring RetVal variable: Dim RetVal Place this declaration at the beginning of procedure Macro1(). The text format of subroutine Macro1() would look something like this: Sub Macro1() Dim RetVal RetVal = Shell("C:\Program Files\Workspace Macro Pro 6.5\ Workspace Macro Pro.exe Ed.wksp /u", 1) End Sub Hope that helps. |
| |||
| Hello, Thanks for your prompt reply. I tried your code as Dim retval as Long retval = Shell("C:\Program Files\Workspace Macro Pro 6.5\Workspace Macro Pro.exe Ed.wksp") after moving Ed.wksp into same directory as Workspace Macro Pro.exe this worked fine. I hopr this helps anyone who wants to start and run Workspace Macro Pro 6.5 macro's from their VB Studio 2005 programs. Thanks again for your help! edzone |