Hello
I made a macro in solidworks that mainly allows me to automatically save the PDF of a drawing from an open and active part in solidworks.
My macro works as long as the part opened in solidworks is stored either locally on the PC or via EPDM. On the other hand, if the part opened in solidworks is stored on my company's network (Fileserv) the macro does not work.
Having noticed this malfunction, I retrieved the registration address of my PDF file using the MsgBox command. And I noticed that when I'm working on a part that's stored on the network, the address starts with " \\Fileserv\..." ". Whereas, when the macro is working correctly, the address starts with the storage disk reference " X:\.... ".
It would therefore seem that the problem comes from the " \\ ".
So I did some research on this problem. And it seems that the Dos FTP command can allow me to correct my macro.
However, from what I understand, this command requires you to fill in login and mdp. I preferred to avoid having to fill in this information because I set up the macro to make saving in PDF easier and faster. However, such a request, in my opinion, would cause the gain brought by the macro to be lost.
Knowing that the macro is being executed from an already identified session on the corporate network, isn't there another way to fix the problem in a way that is transparent to the macro executor?
Beginner in the creation of code in VBA and computer science not being my richest and most effective field of expertise, I am asking for your help in order to advise me and try to correct my problem.
Thank you.
Attached is the code of my macro.
record_pdf_auto.txt