CAD Macro/Automation

Created by ashish kumar on 8 May, 2018

I am learning VBA , i got stuck in Next loop command. Please any one can help me out.below is the program which i made.


Sub CATMain()

Dim doc1 As Documents

Set doc1 = CATIA.Documents

Dim doc2 As Document


Dim i As Integer

For i = 1 To CATIA.Documents.Count

'while running the program in VBA, it shows an error in the above line

    Set doc1 = CATIA.Documents.Item(1)

    MsgBox doc1.Name

Next

End Sub