Results 1 to 2 of 2

Thread: Noch Problemen (yet problems :P )

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jul 2005
    Posts
    236

    Noch Problemen (yet problems :P )

    Hi

    At the point, where I have the swApp.opendoc6, VB says 'Argument not optional' - what am I making wrong this time?
    VB Code:
    1. Private Sub cmdExcel_Click()
    2. Dim swApp As Object
    3. Dim AppEx As Object
    4. Dim SWModel As SldWorks.ModelDoc2
    5. Dim WB As Object
    6. Dim x As Integer
    7.  
    8. Set swApp = CreateObject("SldWorks.Application")
    9. Set AppEx = CreateObject("Excel.Application")
    10. Set SWModel = swApp.ActiveDoc
    11. x = 2
    12. Do While Files.FileName <> ""
    13. swApp.ActiveDoc.ActiveView.FrameState = 1
    14. Set SWModel = swApp.OpenDoc6(Files.Path & "\" & Files.FileName)
    15. Set WB = GetObject(, "Excel.Application")
    16. Set SWModel = swApp.ActivateDoc(Files.FileName)
    17.  
    18. WB.Cells(x, 1).Value = SWModel.GetPathName
    19. WB.Cells(x, 2).Value = SWModel.CustomInfo("tegnnr")
    20. WB.Cells(x, 3).Value = SWModel.CustomInfo("ktegnr")
    21.  
    22. WB.Cells(x, 12).Value = SWModel.CustomInfo("rev")
    23. x = x + 1
    24. Loop
    25. End Sub

  2. #2
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: Noch Problemen (yet problems :P )

    You need to provide extra parameters for OpenDoc6, in addition to the filename.

    I have never used SldWorks, so I can't help with what they might be - you'll have to check the documentation to see what OpenDoc6 requires.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width