Sunday, February 22, 2009

Excel VBA: Runs An Executable Program In Excel VBA Macro

Sometimes, it's very useful to run another application from Microsoft Excel. To runs another application in Microsoft Excel, we can use VBA's Shell function. The following example, will lunch the Notepad application and if the Shell function failed to launch the application, it generates an error.

Sub ExecNotepad()
  On Error Resume Next
  AppVal = Shell("C:\WINDOWS\NOTEPAD.EXE", 1)
  If Err <> 0 Then
      MsgBox "Can't start the application.", vbCritical, "Error"
  End If
End Sub

Related posts:

If you like posts in this blog, you can to support me :)

1 comment:

  1. Hello,

    Dear Webmaster,

    I recently found your Website and I am very interested in exchanging links. I want Link exchange to your web site.

    As you know; reciprocal linking benefits both of us by raising our search rankings and generating more traffic to both of our sites. As a part of ongoing campaigns to increase the Link Popularity of our client's web sites I am looking for some related web sites like yours to exchange links with. I would like to request you consider linking to our site. In exchange, we will link back to your site. Please add my link and reply me positively and I will do the same. Details of my site are as follows:

    Title:- php programmers and custom php software and ecommerce Solutions Company


    Description: is a web development company, providing effective offshore IT outsourcing services and specializing in custom PHP Web applications development, e-commerce solutions, content management systems, shopping carts, multimedia solutions, search engine optimization and much more.

    I will add your Link here

    usha sharma