View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
sunspot27[_2_] sunspot27[_2_] is offline
external usenet poster
 
Posts: 1
Default Userform and Macro code

I have the following code to switch to an open application (ACT! database)
and send the following keys. This works fine as a stand alone macro however,
when i add the same code to a button in a User Form, it doesnt work.

Can someone help?

Sub Export()

'Does an export of the ACT database

AppActivate ("ACT!"), True
Application.SendKeys ("%f"), True
Application.SendKeys ("d"), True
Application.SendKeys ("e"), True
Application.SendKeys ("{TAB}"), True

End Sub