Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel VBA and API calls? 1

Status
Not open for further replies.

ijr

Technical User
Apr 4, 2001
24
TR
1)Has the VBA built into excel capacity to make API calls?

2) If yes, is it possible to run a DOS batch file from an Excel VBA call

If yes, how?

I will appreciate all pointers

Thanks in advance
IJR
 
Sure. Do a search for Shell and/or ShellExecute in this forum. There are tons of samples.
 
Thanx dsi

but I am new to the stuff. I did the search. However I guess there is no harm if you cite a short example down here. Sorry boss if this is too much.

respects
IJR
 
Sure, here you go. You can use the help on vbMaximizedFocus to find other window options (vbHide, vbMinimizedFocus...).
Code:
Sub RunBatFile()
    Dim ret
    ret = Shell("C:\YourFile.bat", vbMaximizedFocus)
End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top