I RECENTLY STARTED LEARNING SOLIDWORKS VBA.
WHENENVER I WANT TO ADD USERFORM IN THE VBA CODE
SOLIDWORKS CRASHED EVERYTIME.
I add another user account to pc.
and install solidworks in that account.
it works fine and i can add userform in vba.
thanks you so much all of you.
Can you post your macro here? there is no reason SW crashes while adding a userform?
EDIT: can you download the att. macro and run
if no crash, you can use it for your macro
Hi, christian chu.
thanks for replying so fast to my problem.
when i am tried to run your macro,
I got an error as you can see in image.
"a serious errpr occured on open macro file.
the system could be in an unstable state now."
Before running the macro, can you go to Tools pulldown menu and select References.... and capture image and post here - see below image
Christian Chu is showing you that you need to check Microsoft Forms 2.0 Object Library. you need to add this reference
Thank you, Jacob
You need to load the Microsoft obj. lib. so so can add window form to your macro
Thanks Christian chu,
Can you please tell me how to do that?
Roll the bar down find and check Microsoft Form 2.0 Object Library - see below image
there is no reference like that in list
i tick that but same problem occurs.
please see the video i attached to original post.
What is SP of your SOLIDWORKS?
Also please refer to this article : Instability in SOLIDWORKS due to conflict with Microsoft KB3072630
Can you try reinstalling SOLIDWORKS or check if that KB affects your machine?
Can you try to replicate the issue on some other machine?
i reinstall solidworks but same problem .
I also tried to other machine , it is working fine in other pc.
Sorry , but how to check KB affects or not my machine?
Raumik Rana wrote: i reinstall solidworks but same problem .I also tried to other machine , it is working fine in other pc.
Raumik Rana wrote:
Can you import SOLDIWORKS settings from that other machine and check again?
i do that.
but same problem.
can you send me other setting so i can check with that?
Can you please report this your VAR and send them the Rx file from your machine?
MrExcel Message Board
You need to follow these steps .
Go To C:\WINDOWS\system32
Search For FM20.DLL
if it doesnt exist go to
Click on Turn Windows Features On or Off
make sure .net framework 3.5 (Includes .net 2.0 and 3.0) is checked like this
Seems to me that you didn't follow any help we provided here. I watched the video and didn'tsee you rolled the bar down to find the Microsoft obj. Lib.
I think it's best to contact your VAR so they can go thru all steps with you
And also you need to get some basic knowledge of windows and VBA before proceeding a macro - trial and error won't get you anywhere !
but after that i browsae fm20.dll and tick microsoft forms 2.0 object library.
uncheck solidworks utilities 2015 type library
Ok.. So did it work now?
is there any problem with windows ?
Can you share you screen over Team Viewer to see if the issue can be debugged? If yes then PM me.
But maybe tomorrow.
So that signifies issue with your SW install. Thanks for sharing the method which worked for you.
you welcome Sir.
Can you please guide me to learn programming for solidworks.
I am mechanical engineer and have experience of 2 years in solidworks.
Now i want to learn something more about solidworks and macro.
Check replies in this post: https://forum.solidworks.com/message/364355#comment-364355
I'm having the same issue than Raumik about the userforms. I'm running SW2015 on Win10 PRO.
I was able to get the "Microsoft Forms 2.0 Object Library" reference loaded but the crash still occured.
What course of action would you recommend me to fix the issue, considering that my user is registered on a domain and I can't just create a new one.
I'm figuring I should uninstall Solidworks (wich I did many times already trying to fix the issue) and then clean some folders in the %appdata% area. If you would give me some pointers I would appreciate.
Mathieu, sorry for a delayed response. Can you try running SOLIDWORKS in Bypass mode and then try the userform?
For bypass mode, open SOLIDWORKS Rx tool and use the bypass mode.
Other option is to reinstall .NETFrameWork and check.
Further open Excel and insert a new macro with a userform and see if that works fine or not.
We have been having the same issue on one of our machines here. It has windows 10 on it but another computer with windows 10 works fine. We tried, re-installing the .net framework. We tried runing in the various safe modes as you suggested, we tried removing SolidWorks entirely from the computer and reinstalling as a stand alone installation (the original was installed with an admin image). Excel macros with userforms work fine. So far my VAR has not come up with a solution based on my Rx Captures either. Do you have any other idea what to try?
Dave, any chance if you have MS office 35 installed?
Deepak, No but I just heard back again from SolidWorks Tech support and they have given me a fix. From their email:
#1: Install/reinstall certain prereqs that come bundled with SolidWorks. Please see attached for a list, you can find these under <SW DVD Download>\Prereqs #2: This is related to a recently discovered bug, documented in SPR 1053482 "SOLIDWORKS crashing upon inserting a userform in macro, or running macro with form in it." 1. Close SOLIDWORKS 2. Open Windows Explorer and Browse to %appdata%\Microsoft\forms and rename 'sldworks.box' ---
This did the Trick for me (see .png attached for where to find .msi and .exe files to uninstall/reinstall!)
Thanks Dave for sharing, might come in handy.
I am experiencing this same issue. A coworker of mine also has the same problem. Perhaps a Windows update is causing it? I followed all the above advised steps. including a fresh reinstall of SW. Oddly enough adding a new user account to my PC also fixed the issue for me. I did not have to install SW for that user though.
For anyone still experiencing this problem :
I just heard back again from SolidWorks Tech support and they have given me a fix. From their email:
#1: Install/reinstall certain prereqs that come bundled with SolidWorks. Please see attached for a list, you can find these under <SW DVD Download>\Prereqs#2: This is related to a recently discovered bug, documented in SPR 1053482 "SOLIDWORKS crashing upon inserting a userform in macro, or running macro with form in it."1. Close SOLIDWORKS2. Open Windows Explorer and Browse to %appdata%\Microsoft\forms and rename 'sldworks.box'---
You mention renaming 'sldworks.box' but what are you renaming it to?
I'm also having this problem of SolidWorks crashing when inserting a userform.
We purchased 4 new desktop machines with identical hardware and 3 identical laptops. I've been able to reproduce this problem on 2 of the desktops (users haven't been around to test on the other two ) consistently but NOT on the laptops. The laptops have NO problems adding a userform.
I do know that the Microsoft Forms 2.0 object library is NOT listed on the desktops under the references dialog. I CAN however add it using the browse button but it still crashes when adding a userform.
Also another possibly weird thing is that we have some macros which ALREADY contain a userform (and weren't working for sometime on all of the machines due to a corrupt userform that I re-wrote the code to not use any more) these recovered macros containing a userform run with out problems right now.
FYI System info
Windows 10, SolidWorks 2017 SP4
Chris Mackedanz wrote: You mention renaming 'sldworks.box' but what are you renaming it to?
Chris Mackedanz wrote:
Just rename to anything such that this file is created again (just my thought)
Retrieving data ...