4 Replies Latest reply on Feb 22, 2016 11:10 AM by Dennis Bacon

    Unable to save to .vbproj

    Dennis Bacon

      I know nothing about API so please bear with me. I have done quite a bit of autolisp programming years ago and was very happy with what I was able to accomplish. I thought I would get to know something about creating, writing, and editing macros so I shelled out some bucks for a book (SolidWorkks 2015 Using Macros). I ran into an issue right off the bat. The book asks you to record a simple macro and save it as .vbproj. When I stop recording I get a "save as" and select the .vbproj extension and name it then save. When I go to edit it there is nothing in the directory I saved it to (not a filter thing). If I save it as .swp it does save and is there but the code does not look anything like what I see in the book but works well when I run it. I'm using Windows 7 64 bit Prof..... What am I missing?... I do see VSTA as an Installed program but I do not see Visual Basic.. Could it be I'm missing something that was supposed to be installed with SolidWorks? I'm using 2014, 2015, 2016 Professional.

       

      I know you can guide me in the right direction and I certainly appreciate the help.

        • Re: Unable to save to .vbproj
          Artem Taturevych

          Hi,

           

          Try reinstalling your VSTA.

           

          In Control Panel -> Programs and Features select SolidWorks and click Change/Uninstall.

           

          • Select Change
          • Deselect the 'Visual Studio for Applications (VSTA) component' under the SolidWorks node
          • Run the installation

           

          After finished run the 'Change' again but now select the 'Visual Studio for Applications (VSTA) component' under the SolidWorks node

           

          You may also just do a repair of your SolidWorks but this will take longer.

           

          Thanks,

          Artem

            • Re: Unable to save to .vbproj
              Dennis Bacon

              Thanks for the reply Artem.. I tried to do a repair (change) on Microsoft Visual Studio 2005 Tools for Applications - ENU but the only option I get is to uninstall. I tried it on VSTA 2015 SDK which I downloaded and installed yesterday as a shot in the dark (and out of ignorance) and did get the option to repair but no SolidWorks node?.. I'm thinking maybe I should delete these, do some registry fiddling, and do a repair on SW. Would it matter which SW version I repaired?.. Years ago was having trouble installing a new version of SW, called my Var, and was told to do this (still have the email) and the installation would would add the correct VSTA in. SW installed as expected after that. Your thoughts?

                • Re: Unable to save to .vbproj
                  Artem Taturevych

                  Hi Dennis,

                   

                  Sorry for the confusion. I meant change/repair SolidWorks installation (not Visual Studio). And there you will see the VSTA components under the SOLIDWORKS products.

                   

                  Please see the snapshots below.

                   

                  • Select the SolidWorks installation in the Windows Control Panel

                  • Select modify the installation

                  • Click next on the license validation window and OK if you have a warning regarding the KB
                  • Expand the SOLIDWORKS node

                  • Scroll down to VSTA node. If this option is unchecked just check it to install. Otherwise uncheck it and continue. Once finished do the same modification but check it (uninstall-install 'roundtrip')

                   

                  Thanks,
                  Artem

                    • Re: Unable to save to .vbproj
                      Dennis Bacon

                      I just think I need to follow directions more closely. Thank you for the screenshots. That does make sense. I did not have VSTA checked so I checked it and it seemed to install but no difference. Still not able to able to save a macro as .vbproj. I tried to upgrade my 2015 from SP2.1 to SP5.0 but got a bunch of Install errors. Thank goodness it still works as 2.1. Perhaps I will try a repair a little later.Thanks again for your efforts. I sure would like to utilize the book I bought to better understand API. Maybe Win 10 is in my future but then I don't think I will have the ability to use my 2014 version which I use from time to time to send a file to someone on the forum.