Intelligent Automation & Macro Software  

Go Back   Tethys Solutions Forums > Products Zone > Workspace Macro Pro - Automation Edition
Register FAQ Search Today's Posts Mark Forums Read

Workspace Macro Pro - Automation Edition Post messages and questions related to Macro Software for Windows Automation here.


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 09-17-2007, 05:54 AM
edzone edzone is offline
Junior Member
 
Join Date: Sep 2007
Posts: 2
Post Running macro's from within VB Studio 2005 forms

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.
Reply With Quote
  #2 (permalink)  
Old 09-19-2007, 11:01 AM
forumsupport forumsupport is online now
Senior Member
 
Join Date: Apr 2007
Posts: 456
Default Re: Running macro's from within VB Studio 2005 forms

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.
Reply With Quote
  #3 (permalink)  
Old 09-21-2007, 12:26 AM
edzone edzone is offline
Junior Member
 
Join Date: Sep 2007
Posts: 2
Default Re: Running macro's from within VB Studio 2005 forms

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
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -7. The time now is 12:36 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.0.0 ©2007, Crawlability, Inc.
Copyright © 2003-2008 Tethys Solutions, LLC. All rights reserved