Community
AutoCAD LT Forum
Welcome to Autodeskā€™s AutoCAD LT Forums. Share your knowledge, ask questions, and explore popular AutoCAD LT topics.
cancel
Showing results forĀ 
ShowĀ Ā onlyĀ  | Search instead forĀ 
Did you mean:Ā 

Open Autocad 2019LT from Excel vba

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
rick.sinclair
886 Views, 2 Replies

Open Autocad 2019LT from Excel vba

Hi 

Can some one help me please I have an excel vba program which was working with office 365 and AutoCAD 2018LT. Now I've got a new machine with AutoCAD 2019 and it fails on opening AutoCAD. I've updated the refs to 2019 - (the only ref I couldn't find was AcFocusCtrl16.dll if that's the issue where can I get it?) but I get a application defined or object defined error. I've tried Set Graphics New AcadApplication but this doesn't work either. 

 

Any help would be greatly received. 

 

Rick

 

'Open AutoCAD DIN Cabinet file


   'Dim Graphics As Object
   Dim dwg As Object
   Dim Graphics As AcadApplication
   'Dim dwg As AcadDocument
    
   On Error Resume Next
   Set Graphics = GetObject(, "AutoCAD.Application")
    
    If Graphics Is Nothing Then
        'AutoCAD is not running or not reacting, so we create a new process
        Set Graphics = CreateObject("AutoCAD.Application")
          
    End If
    
    If Graphics Is Nothing Then
        'if that failed too something not correct
        UFWait.Hide
        MsgBox "Failed to open AutoCAD open manually and try again", vbCritical
        Exit Sub
    Else
       
        Set dwg = Graphics.Documents.Open(CADRS)
        Graphics.Visible = True
        On Error GoTo 0
   
    End If

   

 

Labels (2)
2 REPLIES 2
Message 2 of 3
steven-g
in reply to: rick.sinclair

AutoCAD LT doesn't respond to external open commands, that is only available with the full version of AutoCAD so I would be very surprised if it used to work with 2018LT, to be honest, I would be very pleased if it did, but the API's required for this are not in LT.

Message 3 of 3
pendean
in reply to: rick.sinclair

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

Post to forums  

Technology Administrators


Autodesk Design & Make Report