Running Other Programs from Excel

Posted on Saturday 18 March 2006

Hi, Been really busy both at work, and at home recently so I have not had as much time to blog as I would have liked. Things are still very very very hecktic, but, I'll try hard to put some posts up... to wit:

You can use the Shell command to run programs on your pc, this code run the windows calulator for eaxmple:

Sub CallAccessRunTime()

Shell pathName:="C:\WINDOWS\System32\calc.exe", _
windowStyle:=3

End Sub

The last arugment can be passed the following values:

Value Value (string) Result
1, 5, 9 vbNormalFocus Normal with focus

2 vbMinimizedFocus Minimized with focus

3 vbMaximizedFocus Maximized with focus

4, 8 vbNormalNoFocus Normal without focus

6, 7 vbMinimizedNoFocus Minimized without focus


2 Comments for 'Running Other Programs from Excel'

  1.  
    Ivan F Moala
    24 March 2006 | 11:59 pm
     

    Whilst shell is usefule for your own use, I have found the ShellExecuteA API a lot more robust, especially for developing for others.

    Have a look here....

    http://www.xcelfiles.com/shellexecutea.html

  2.  
    27 March 2006 | 9:55 am
     

    Thank for the link Ivan, that does look more poverful.

Leave a comment

(required)

(required)


.

Use [VBA] Your Code [/VBA], when posting code, cheers Ross x /


RSS feed for comments on this post | TrackBack URI