For 3 years now, it has been impossible for us to create Solidworks files from an Excel macro. This worked before we switched our PDM server to the 2020 version and still the same error in 2022.
When we use the copyfile, the SetVar (among others) in a macro we get an error (see image).
It works if you use the macro on a text file for example but impossible on a sldprt or sldasm.
Hello I had the problem with the programs I created (in C#) during our visit to Epdm 2022. I fixed this problem by targeting a different processor architecture when compiling the executable: On 2019: x86/x64 - prefers 32-bit On 2022: x86/x64 - prefers 64-bit This change actually appeared from the 2020 version. See HERE Kind regards
Maybe another way because it's VBA, you should see your version of VB because I remember that the automatic installation after SW clears the VB7.DLL file (if I remember correctly) and replaces it with a lower version that can make macros unusable. I use updatevar without problem on PDM 2022 with a 32-bit Excel.
Hello FYI, the only function that was causing me problems was "SetVar", all the other functions I use in my programs worked perfectly. I can't say that it's the same problem because it's vba but it really looks like it, it's worth testing... Kind regards
Thank you both for your answers, it gave me some avenues to explore, unfortunately for the moment I haven't found a solution but I'll dig a little deeper.