Visual Sudio 2022 and Solidworks 2024

Hello everyone.
Previously I created an exe from Visual Studio 2013 and now that I have switched to Visual Studio 2022 I am experiencing problems that I can't understand/solve:
Example:
On the line of code
" Set Part = swApp.NewDocument(" W:\000 - Model\Model File\Piece.prtdot ", 0, swSheetWidth, swSheetHeight) "
Visual studio tells me that the " Set " is no longer supported, that it must be removed.
Once I remove it and launch the app, it tells me that this same line of code
cannot be executed because the object is not loaded (the famous SET that should no longer be used).
Is anyone programming Sw with visual studio 2022?
In advance, thank you very much for your help.

Option Explicit

Dim swApp As SldWorks.SldWorks
Dim Part As SldWorks.ModelDoc2

Sub main()

    swApp = Application.SldWorks
    
    Part = swApp.NewDocument("W:\000 - Model\Modele fichier\Piece.prtdot", 0, swSheetWidth, swSheetHeight)

End Sub

The " Set " instruction is VBA. In VB.net we don't use this instruction.

Do you want to make a macro in VB.net or an app that drives SW?
I've already done both. :wink:

Note that you can also make changes without opening SW with the SW Document Manager API

1 Like

Thank you for the answer. I'm looking to make an app (exe) that drives Sw

1 Like

Have you ever done Vb.net ?

1 Like