Private Sub AppActivates(WindowName As String) Dim WD, task, n As Long Set WD = CreateObject("Word.Application") For Each task In WD.Tasks MsgBox task.Name Next WD.Quit Set WD = Nothing End Sub
Private Sub ActivateAutoCad() Dim ACApp As Object On Error Resume Next Set ACApp = GetObject(,"AutoCAD.Application") If Err Then Err.Clear MsgBox("AutoCAD application is not running") Else ACApp.Activate 'or 'ACApp.SetFocus 'or 'ACApp.Visible = True End If Set ACApp = Nothing End Sub
AppActivate "AutoCAD"
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)