How to control application

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Veksi
    New Member
    • Jan 2007
    • 2

    #1

    How to control application

    Hi, everyone. I have this code when I'm trying to control application. These works correct, but I can’t run the next item of the application. There are buttons Finish and Cancel on the Popup, but how can I send the message of Popup-window. Application don’t take commands before or after execute. It run always application execute command end of Sub.

    Sub DMEU()
    'First, how to find FindControl ID for FindControl
    'and Execute "Database Merge Export Utility"?
    'ID: 39812

    Dim myCommand As Object
    Dim a
    Dim b As Object
    Dim buf() As Variant
    Dim i As Long
    Dim test
    Dim testi_2

    Set a = Application.Com mandBars.FindCo ntrols

    'loop commandbars object
    For Each b In a
    i = i + 1
    ReDim Preserve buf(1 To 2, 1 To i)
    buf(1, i) = b.Caption
    buf(2, i) = b.ID

    If b.Caption = "Database Merge &Export Utility" Then
    MsgBox (b.ID)
    test = b.ID
    End If
    Next
    'This code would show the "Database Merge Export Utility" dialogue box.
    Set myCommand = Application.Com mandBars.FindCo ntrol(ID:=test)
    myCommand.execu te

    ' Controls ???

    End Sub
  • MMcCarthy
    Recognized Expert MVP
    • Aug 2006
    • 14387

    #2
    This question is being moved to the Visual Basic forum.

    ADMIN

    Comment

    • Killer42
      Recognized Expert Expert
      • Oct 2006
      • 8429

      #3
      I'm finding this question quite difficult to follow. Partly the problem is lack of context. for instance, is this in:
      • VBA (Excel? Access? other?)
      • VB6
      • VB.Net (which version?)
      • Something else

      Comment

      Working...