Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 747
Default Pressing a button using a macro

This worked:

Sub XYZ()
Dim wb As Workbook
Dim Btn As Shape
Set wb = Workbooks.Open(ThisWorkbook.Path & "\" & "MyWorkbook.xls")
ThisWorkbook.Activate
Set Btn = wb.Sheets("Data").Shapes("Button 1")
Application.Run Btn.OnAction
End Sub

Regards,
Greg

"Todd" wrote:

Hi,

I'm writing a macro which opens another sheet which also contains macros
which update a DB2 database. It contains a button which is update database, i
need to know how i can have my macro simulate pressing this button

Reply
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
How do I create a macro that increments +1 by pressing a button Dave Excel Discussion (Misc queries) 2 June 15th 07 10:11 AM
Excel: Change content A1 with B1 by pressing one button <- Elvira Idea Excel Worksheet Functions 0 November 25th 05 01:40 PM
Sending e-mail with Lotus Notes pressing an excel button AndyOne Excel Discussion (Misc queries) 0 June 1st 05 09:29 PM
Sending data in certain cells to another worksheet by pressing a button RPIJG Excel Programming 14 May 12th 04 11:38 PM
pressing the "reset" button and freeing memory Elie W Excel Programming 1 February 12th 04 07:44 PM


All times are GMT +1. The time now is 07:48 AM.

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

About Us

"It's about Microsoft Excel"