16 Replies Latest reply on Sep 21, 2011 2:56 PM by Jim Bacon

    Can no longer edit macros

    Jim Bacon

      Help!

       

      I created two new macros but I'm not longer able to edit or run them.  I don't recollect exactly what happened but SolidWorks crashed while running a macro.  The macros read and write from/to Excel.  After the crash, I could no longer edit or run the macros.  When I select the macros/edit menu item, I can select the macro but the editor never opens.

       

      I disabled the UAC.  Before that, I couldn't even get to the window that allows me to select the macro for editing.

       

      I'm using SW2011 with Windows 7.

       

      Thanks,

       

      Jim

        • Re: Can no longer edit macros
          Deepak Gupta

          It can be a VBA issue. Try following if they works for you:

           

          1. Try reinstalling/updating your .Netframeworks (http://www.update.microsoft.com).
          2. Reinstall SolidWorks
            • Re: Can no longer edit macros
              Jim Bacon

              Hi Deepak,

               

              I tried item #1.  There were updates so I installed them.  That unfortunately didn't work.

               

              For #2, I tried upgrading from SW2011 SP3 to SP4.  I get this error message from the installation manager:

               

              "The following products cannot be upgraded because they were installed from an administrative image: SolidWorks, SolidWorks eDrawings and SolidWorks Explorer/Workgroup PDM"

               

              I originally installed from the DVD that SolidWorks sends out yearly and have never had this problem before.  Strange.

               

              I'm at a loss.  I may uninstall 2011 and start over.  BTW -- I also have 2010 installed.  It has the same symptom with the macro editor.  I can't view the macros or run them.

               

              Thanks for your help,

               

              Jim

                • Re: Can no longer edit macros
                  Deepak Gupta

                  Yeah reinstalling might be a way to fix the issue or even you can run a repair of the installation (SP 3.0) if you still have the installation image.

                    • Re: Can no longer edit macros
                      Jim Bacon

                      Hi Deepak,

                       

                      I uninstalled SP3 and reinstalled SP4.  Amazingly, the problem still persists.  I'm at a loss.

                       

                      Thanks for your help,

                       

                      Jim

                        • Re: Can no longer edit macros
                          Deepak Gupta

                          Can it be MS office playing some games. Can you do a quick repair run of MS office.

                            • Re: Can no longer edit macros
                              Jim Bacon

                              Hi: My VAR sent me instructions for thoroughly uninstalling SolidWorks.  This entailed renaming lots of registry items and deleting directories manually.  That didn't fix the problem.  Below is a status that I sent my VAR.  They are working with SolidWorks Headquarters.  Note that I do have one positive symptom.  Not sure what to try next.

                               

                              I’ve uninstalled and reinstalled about everything I can think of to no avail.  The list is below.  On a positive note … I created another account with admin privileges, and Solidworks works there.  My account has admin privileges but SolidWorks doesn’t work.  I set my user account control settings to the lowest level to no avail.  I’m at a loss and going to bed. 

                               

                              Software uninstalled/reinstalled:

                              Microsoft Office

                              MS Visual C++ 2005 redistributable (both x64 and x86)

                              MS Visual C++ 2008 redistributable (both x64 and x86)

                              .Net Framework 4

                              Office Web Components

                               

                              I also did a repair on MS Visual Studio 2010 which I have installed.  I uninstalled MS Visual Studio 2005.

                               

                              Given that the software works in another account, I figure it has something to do with my account configuration.

                               

                              Thanks for your help,

                               

                              Jim

                        • Re: Can no longer edit macros
                          Wayne Tiffany

                          Have you tried renaming the CU key to see if you can then edit macros?  That's a quick test.

                           

                          Can you edit any macros at all?  Or is it just these two that cause the problem?

                           

                            WT

                            • Re: Can no longer edit macros
                              Jim Bacon

                              Hi WT,

                               

                              I normally create C++ add-ins and am new to VBA and macros (just a couple months).  What is the CU key and what macro editor is available to use?  I'm only familiar with the SolidWorks editor which edits the swp files.

                               

                              I tried opening other macros and creating a new one.  The "open" window appears when trying to edit a macro but the editor never opens.  The "save as" window appears when trying to create a new macro but the new macro never gets created and saved.

                               

                              Very confusing.  I'm amazed that reinstalling didn't work.

                               

                              Thanks,

                               

                              Jim

                              • Re: Can no longer edit macros
                                Wayne Tiffany

                                CU = CurrentUser key in the registry.  If you are familiar with the registry, you can go to the CU Solidworks key, rename it by adding STASH or something to the end of it, then start SW.  At that point it will recreate that key from the data in the LocalMachine key.  If the problem is then fixed, then it was something in your reg settings.  If not, then it's either elsewhere or it's also in the LM key, which is unlikely.

                                 

                                The thought on trying to edit another macro is to see if all macros are now unavailable to you, or just those particular ones.  Turn on your Macro toolbar and hit the button for Edit Macro.  Then pick an existing one and see what you can do with it.

                                 

                                  WT

                            • Re: Can no longer edit macros
                              Jim Bacon

                              Hi Deepak,

                               

                              I finally fixed the problem though there is still some confusion.  The crux of the problem is that the SolidWorks VBA server uses VB6 and VB6 was somehow corrupted.  I tried cleaning out VB6 and reinstalling it but that isn't easy to do.  Clearing the registery of VB6 is tricky and risky.  My efforts fixed some issues but created new ones ... even in other applications.

                               

                              In the end, I remembered that I created a system restore point back in late July.  I went back to that restore point and all problems were gone.  My account now works fine.

                               

                              BTW -- My VAR was very unhelpful with this problem.  None of their advice was helpful.

                               

                              Thanks,

                               

                              Jim

                            • Re: Can no longer edit macros
                              Wayne Tiffany

                              I presume you already tried the usual IT answer - reboot the machine?  Could be some process left over in the RAM that is messing with you.

                               

                                WT

                                • Re: Can no longer edit macros
                                  Jim Bacon

                                  Hi WT,

                                   

                                  Thanks for the suggestion.  I have rebooted many times. 

                                   

                                  Jim

                                    • Re: Can no longer edit macros
                                      Markku Lehtola

                                      Hmm, because another account works how about deleting your Windows user profile, maybe the one that is not working is corrupted..You loose some settings, but not the account.

                                       

                                      br

                                      Markku

                                      www.sloworks.fi

                                        • Re: Can no longer edit macros
                                          Jim Bacon

                                          Hi Markku,

                                           

                                          In Windows 7, I can see how to delete the account, which potentially deletes files.  It warns about deleting email and other things.  How do you delete and recreate a profile without deleting any files?  Might you have a link that shows how to do that?

                                           

                                          I was planning to create a new account and slowly migrate all my stuff to it.  Your approach sounds easier.

                                           

                                          At the moment, I'm awaiting feedback from SolidWorks and my VAR.

                                           

                                          Thanks for your help,

                                           

                                          Jim

                                            • Re: Can no longer edit macros
                                              Markku Lehtola

                                              Hi, deleting profile is different than deleting account. When you delete account's profile you (as far as I know) loose these:

                                               

                                              desktop settings, favorites, program-specific data that is contained in the Application Data folder, and the contents of the My Documents folder.

                                               

                                              Delete profile: Control Panel-System- Advanced system settings-Advanced-User profiles. You must logon with other account to delete account's profile, so you may need to create a new account for this job anyway.

                                               

                                              New clean profile is created automaticly. I have repaired some CAD-related problems years ago by creating new profile...maybe it helps in this case.

                                               

                                              br

                                              Markku

                                              www.sloworks.fi

                                                • Re: Can no longer edit macros
                                                  Jim Bacon

                                                  Hi Markku,

                                                   

                                                  Thanks for your suggestion.  I never did figure out how to delete a profile and nothing else.  Eventually, I fixed the problem through a system restore to a point before when the problem occurred.  Fortunately I had a recent system restore point.

                                                   

                                                  Thanks for your help,

                                                   

                                                  Jim