Scoutr4 Posted March 30 Share Posted March 30 I am using two monitors. I open a separate AutoCAD application for each monitor. When I run a macro via Excel VBA, I can only capture the AutoCAD application that I first opened. I couldn't find a solution to capture the other application as well. Is there any solution? What I want to do is run the macro in the dwg file I selected. Quote Link to comment Share on other sites More sharing options...
BIGAL Posted April 1 Share Posted April 1 Why 2 applications you can have 1 big CAD across 2 screens and have 2 windows open, re code may need to set which window is active before running the excel. Split the Excel into 2 functions get the object application then set active window bit like Excel set active sheet, so no real ideas past this point. Other than this may provide some clues. (setq acDocs (vla-get-documents (vlax-get-acad-object))) (vla-put-activedocument (vlax-get-acad-object) (vla-item acdocs 1)) Quote Link to comment Share on other sites More sharing options...
Scoutr4 Posted April 1 Author Share Posted April 1 The reason I use 2 applications is because I open more than 15 dwg files. I separate the files according to their properties and put them in separate applications. In this way, I can organize files more easily. I don't have this problem as I can create Floating Drawing Windows in newer versions of Autocad but since old versions are installed in the office, I encounter this Excel problem. Thank you for the advice. Quote Link to comment Share on other sites More sharing options...
SLW210 Posted April 1 Share Posted April 1 This might be something better asked in an Excel or Microsoft forum. If you are initiating this through Excel, this would be more an Excel issue. What version of AutoCAD is at the office? Lots of examples running batch on files, including .dwg/.dxfs, etc. why do they need to be opened in two instances of AutoCAD, no need to make life more difficult if unnecessary? I realize you have your preference and may be possible, VBA might not be the best route, it would help to know what you are trying to do. https://stackoverflow.com/questions/26277214/vba-getting-program-names-and-task-id-of-running-processes https://learn.microsoft.com/en-us/office/vba/Language/Reference/user-interface-help/getobject-function Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.