Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
appactivate
I have tried to use the appactivate command but can not
get the focus back to excel after I gather info from another application. Attached is my code. Can anyone tell me how to get excel back on top? Private Sub CommandButton2_Click() ' Dim ACAD As Object Dim MS As Object Dim myappid Set ACAD = GetObject(, "AUTOCAD.APPLICATION") Set MS = ACAD.activedocument.ModelSpace AppActivate "autodesk" ' Dim llpc As Variant Dim urpc As Variant Dim htft, htin, wdft, wdin ' With ACAD.activedocument.Utility llpc = .GetPoint(, vbCr & "Pick the Lower Left Panel Corner: ") urpc = .GetPoint(llpc, vbCr & "Pick the Upper Right Panel Corner: ") End With ' With Worksheets("A") ' ' .Range("c22").Value = 0 .Range("d22").Value = 0 .Range("c21").Value = 0 .Range("d21").Value = 0 ' wdft = Application.WorksheetFunction.RoundDown ((urpc(0) - llpc(0)) / 12, 0) wdin = (urpc(0) - llpc(0)) - (wdft * 12) htft = Application.WorksheetFunction.RoundDown ((urpc(1) - llpc(1)) / 12, 0) htin = (urpc(1) - llpc(1)) - (htft * 12) ' .Range("c21").Value = htft .Range("d21").Value = htin .Range("c22").Value = wdft .Range("d22").Value = wdin ' End With AppActivate "Microsoft Excel" End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
appactivate | Excel Programming | |||
Running a .bat file via AppActivate | Excel Programming | |||
AppActivate problem when called twice | Excel Programming | |||
AppActivate trouble... | Excel Programming | |||
appactivate sendkeys not working with accelerator | Excel Programming |