Transferring focus to BricsCAD with VBA

I have spent a few hours trying to figure this out, so it is time to go to the collective wisdom on this forum.

I have a VBA app that runs in Excel. Briefly,
1) It opens a new document in BricsCAD
2) Draws an object.
3) Converts that drawing to a block.
4) Copies that block to the clipboard.
5) Closes that temporary drawing.
6) [this is the part I can't figure out] Makes BricsCAD the active window, so the user can paste the new block.

Note that I have already created the following variables, and set them
Public acadApp As AcadApplication
Public acadDoc As AcadDocument
Set acadApp = GetObject(, "BricscadApp.AcadApplication")

The acadDoc variable was set to the new document I created, but that document is now closed. So, I think I can ignore that now.

The following approaches do not work.
acadApp.Visible = True "being visible is not enough. I need it to be set so that user can simply hit Cntl-V to paste the block.
acadApp.ActiveDocument.Activate 'I suspect that this sets BricsCAD to receive comamnds from VBA. But, does not transfer the user's focus to BricsCAD.

This following approach I found on one web site, but the word SetForegroundWindow does not exist in the Excel VBA developer reference.
SetForegroundWindow (acadApp.Hwnd) 'This generates a Compile error: Sub or Function not defined. I may have mis-understand it. I suspect it may only be for user VBA forms.

It may be that the above commands do work, but then focus goes immediately back to the VBA program, even though there is only one other command, End Sub.

Any other ideas?
-Joe

Comments

This discussion has been closed.