Drawing is Busy

Drawing is Busy

eduardo.chavez
Observer Observer
857 Views
1 Reply
Message 1 of 2

Drawing is Busy

eduardo.chavez
Observer
Observer

Hello everybody

 

I have a problem with a Macro. I'm using Autocad 2008.

 

In my macro, I select a folder with DWG files and make a change on an object, save the file, but when I try close file, I get an error "Drawing is Busy" this is my code:

 

 

Private Sub cmdGenerar_Click()
    Dim oFile, fs, obj
    
    Set obj = CreateObject("Wscript.Shell") 'Objeto para las preguntas
    Set fs = CreateObject("Scripting.FileSystemObject")
    For i = 0 To lstArchivo.ListCount - 1
        lstArchivo.ListIndex = i                        'This is a lst with the file in the folder
        cfileDWG = txtCarpeta.Value & "\" & lstArchivo.Text
           
            Application.Documents.Open cfileDWG


             agregaSolDes ' Subrutine that make the change on object


            ThisDrawing.Save   'it's Work Ok


            ThisDrawing.Close    'I get an error and I cann't cotinue
            
    Next
   
End Sub

 

Thanks you.

0 Likes
858 Views
1 Reply
Reply (1)
Message 2 of 2

Mike.Wohletz
Collaborator
Collaborator

What do you get if you try ThisDrawing.Close(False)

or replace the save line with ThisDrawing.Close(True, ThisDrawing.FullName)

0 Likes