AnsweredAssumed Answered

Macro References

Question asked by Rebecca Bemrose-Fetter on May 22, 2017
Latest reply on May 22, 2017 by Rebecca Bemrose-Fetter



I have been tasked with maintaining/updating a VBA macro written by a former colleague. The macro gets a bill of material from a SolidWorks assembly and puts it in Excel, formatting it in several ways for purchasing and input into our work tracking software. I have some familiarity with VBA, but not enough to have written this macro, however I have more comfort with it/programming than anyone else on my team, so it's my project now. For the most part, it works great.


There is one problem. Every time we run the macro after opening a new session of SolidWorks, we must change the reference to a .swp file which seems to be automatically created in a local temp folder. So the first time the macro is run, it fails immediately:

Then, choose to stop debugging and I get this window:

If I deselect "MISSING: Evaluation1.swp" and select "Evaluation1" and press OK, I can compile and run the macro just fine. I tried copying Evaluation1.swp to a different location (on our network) and then browsing for it, but that doesn't work. It seems to be created when the macro is compiled.


What is this file? What does it do? Is there a way to have it reference a fixed location? I'd really like to not have each of my colleagues having to edit the macro when they need to run it, even if it's just the references. I'd like to just have a button on their CommandManager that they can click.


For what it's worth, we are running SolidWorks 2015 SP5.0 - I'm pushing for us to upgrade to 2017, but my supervisor is not ready for that yet. If my problem would be solved by using SW2017, that would certainly help my case.


Thanks for your help.