VBA continues before Documents.Open Method Completes

Discussion in 'AutoCAD' started by Chris Shoemaker, Apr 6, 2005.

  1. I'm starting stimple and trying to just open and then close a list of
    drawings. What i've noticed however is that vba doesn't wait for the Open
    method to complete before continuing with code execution so the program
    dies. What's a good way to wait for a file to open, close, save, etc before
    continuting with the program? Thanks in advance,

    -Chris

    --------------------------------------------

    For ii = 1 To colFileList.Count

    strDwgName = colFileList.Item(ii)

    If Dir(strDwgName) <> "" Then
    ThisDrawing.Application.Documents.Open strDwgName
    ThisDrawing.Close
    Else
    lstLog.AddItem "Error! " & strDwgName & " Does Not Exist."
    End If

    Next ii
     
    Chris Shoemaker, Apr 6, 2005
    #1
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.