Thread: API run program
View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Steve Yandl Steve Yandl is offline
external usenet poster
 
Posts: 284
Default API run program

What type of file is vbimport? Does it have a file extension (you may not
see the file extension if Windows Explorer is set to hide extensions of
known file types but the extension may be important here)? Is vbimport a
batch file or a vbScript file or something else?

Steve Yandl

"Johan" wrote in message
...
Something like this is my code:

Dim Shell
Set Shell = CreateObject("WScript.Shell")
Shell.Run "c:\battest\vbimport", 1
SendKeys "{enter}"

The file vbimport gives an error, and I want to send the key Enter to the
message box.

Thanks
ShaneDevenshire skrev:

Hi,

Please give us more info on what you are doing, like the code. For one
thing, you don't need to call an API to click an OK button. You should
just
build in an error trap, an error handler to deal with the error, and that
can
all be done in Excel.


--
Thanks,
Shane Devenshire


"Johan" wrote:

i am new to programming.
I want to run a program and if it gives an error the OK button should
be
pressed automaticly

Any help to this???

I know that I must use API but how to I activate API in excel?