5 Replies Latest reply on May 15, 2013 9:50 AM by Cory McHale

    Corrupt Macro

    Brian Mick

      Hello,

       

      I have a macro for saving files as a PDF and it has suddenly gone rogue on me.  It was fine until my co-worker tried to save a drawing as a PDF, and it crashed his solidworks.  I tried it on my computer, and crashed my solidworks. 

       

      I deleted the main copy and tried using my backup, but that's corrupted too.  Both files are identical.

       

      Can anyone get the text out of the file? 

       

      Thanks!

        • Re: Corrupt Macro
          Deepak Gupta

          The macro is opening fine. Can you open it in editor?

           

          I've attached the codes in a text file.

            • Re: Corrupt Macro
              Brian Mick

              Deepak,

               

              It works great.  I have no idea what was corrupting it.  Thank you.

               

              Brian

                • Re: Corrupt Macro
                  Cory McHale

                  I've ran into this also, and the only fix I've found is to open and resave the file on our older machine that has SW2012. After that I'm able to edit and run it in SW2013. I wish I understood why.

                    • Re: Corrupt Macro
                      Brian Mick

                      Cory,

                       

                      Thanks for the input.  I have no idea what corrupted the macro, or what is different on Deepak's computer that let him open it just fine.  I couldn't even open the file in the editor - it would crash every time.

                       

                      Thanks for the input about SW2012 - we upgraded all our machines together, so I don't have access to 2012 anymore, but it's interesting that the macro appears uncorrupt in the older version.  Perhaps it has something to do with the fact that I wrote it in 2012? (But I have edited it many times using SW2013 before this sudden corruption).

                        • Re: Corrupt Macro
                          Cory McHale

                          Yeah, I'm lucky our old laptop still has XP on it so we can't upgrade it. I've ran into that issue with macros written both on 2013 and prior, so I'm not certain if that has much to do with it.

                           

                          Now and then, a macro won't run but also won't crash SW, and will allow me to open it in the editor. When this happens, there will typically be multiple instances of the same VB project in the editor. When I close the editor SW prompts me to save " ? ". Not certain what that means. Good luck.