+ Reply to Thread
Results 1 to 2 of 2

Pressing a button using a macro

Hybrid View

Guest Pressing a button using a... 06-06-2005, 02:05 AM
Guest RE: Pressing a button using a... 06-06-2005, 04:05 AM
  1. #1
    Todd
    Guest

    Pressing a button using a macro

    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

  2. #2
    Greg Wilson
    Guest

    RE: 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 to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1