2 Replies Latest reply on Jun 24, 2018 4:57 PM by Eric Snyder

    Getting 2097152 error when loading file using swapp.OpenDoc6

    Eric Snyder

      We have PDM not EPDM


      Using the following code:

             Dim swapp As New SldWorks.SldWorks

              Dim swDoc As SldWorks.ModelDoc2

              Dim errors As Integer

              Dim warnings As Integer

              Dim fileName As String = "path to my file"

              swDoc = swapp.OpenDoc6(fileName, swDocumentTypes_e.swDocPART, swOpenDocOptions_e.swOpenDocOptions_Silent, "", errors, warnings)

      When I load an assembly I am getting the error 2097152. That translates to:

      swFileRequiresRepairError 2097152 or 0x200000 = A document has non-critical custom property data corruption

      The file does not load but I get the value Nothing instead.

      I can load the file manually in the app and get no warnings. I also look at "file properties" and do not see anything wrong.

      I have tried this with numerous combinations of files checked out and not checked out. Nothing allows me to load the file.

      Any tips? Is there a way to repair a file if this happens?