LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 38
Default How to activate command button on form by macro

I'm working on a macro to load, fill out, and run a form. I think I
know how to do everything except run the form. By run the form I mean
"click" the OK command button.

Here's basically what I have (in the same workbook as the form):

Load MyForm
MyForm.textbox = "some text"
MyForm.OKbutton.SetFocus
Application.SendKeys "{ENTER}"

I thought I could set the focus to the OK command button and send the
ENTER key but that isn't working. Should this work or is there some
other way to click the OK command button?

Denis
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
macro attached to command button - VBA form Roy Gudgeon[_2_] Excel Discussion (Misc queries) 2 March 16th 10 12:44 PM
Accessing the text of a form command button from underlying macro Chrisso Excel Programming 6 September 15th 07 03:02 PM
Command Button vs Form Button Bri[_3_] Excel Programming 2 February 3rd 06 08:18 AM
Macro to activate form button kkknie[_90_] Excel Programming 1 May 11th 04 08:31 PM
using 'enter' on a textbox to activate a command button? neowok[_23_] Excel Programming 1 February 25th 04 12:25 PM


All times are GMT +1. The time now is 12:55 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"