VBA
Discuss AutoCAD ActiveX and VBA (Visual Basic for Applications) questions here.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

AutoCAD 2025 opens in background when loading a DWG with VBA

2 REPLIES 2
Reply
Message 1 of 3
martin.cappe
213 Views, 2 Replies

AutoCAD 2025 opens in background when loading a DWG with VBA

Hello everyone,

 

I've recently upgraded to AutoCAD 2025, and I’ve noticed a change in how it behaves when opening DWG files through VBA. In previous versions, if AutoCAD was closed and I used VBA to open a DWG, AutoCAD would launch and display the file on-screen. However, with AutoCAD 2025, the application opens but remains invisible (running in the background) until I manually bring it to the foreground or add code to set the visibility to true

 

This behavior affects the user experience, especially when running scripts that need to display the file for review or further interaction. I was wondering, has anyone else experienced this change in AutoCAD 2025 ?

 

Thanks,

MC

2 REPLIES 2
Message 2 of 3
ed57gmc
in reply to: martin.cappe

Show your code for how you open a dwg.

Ed


Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
How to post your code.

EESignature

Message 3 of 3
almutaz_86
in reply to: martin.cappe

I think you should add some lines to your code

 

Dim acadapp As Object
    ' Try to get the AutoCAD application object
    On Error Resume Next
    Set acadapp = GetObject(, "AutoCAD.Application")
    On Error GoTo 0
    If acadapp Is Nothing Then
        ' AutoCAD is not open, so open it
        Set acadapp = CreateObject("AutoCAD.Application")
    Else
        ' AutoCAD is already open
        acadapp.Documents.Add
    End If
    With acadapp.Visible = True

 

 

maybe you missed last line

 

 

 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

AutoCAD Inside the Factory


Autodesk Design & Make Report