Hi
At the point, where I have the swApp.opendoc6, VB says 'Argument not optional' - what am I making wrong this time?
VB Code:
Private Sub cmdExcel_Click() Dim swApp As Object Dim AppEx As Object Dim SWModel As SldWorks.ModelDoc2 Dim WB As Object Dim x As Integer Set swApp = CreateObject("SldWorks.Application") Set AppEx = CreateObject("Excel.Application") Set SWModel = swApp.ActiveDoc x = 2 Do While Files.FileName <> "" swApp.ActiveDoc.ActiveView.FrameState = 1 Set SWModel = swApp.OpenDoc6(Files.Path & "\" & Files.FileName) Set WB = GetObject(, "Excel.Application") Set SWModel = swApp.ActivateDoc(Files.FileName) WB.Cells(x, 1).Value = SWModel.GetPathName WB.Cells(x, 2).Value = SWModel.CustomInfo("tegnnr") WB.Cells(x, 3).Value = SWModel.CustomInfo("ktegnr") WB.Cells(x, 12).Value = SWModel.CustomInfo("rev") x = x + 1 Loop End Sub


Reply With Quote
