Is there a sensible limit to the amount/quantity you can usethe "modeldoc2.ForceRebuild3(true)" trick ?
In my case at a certain moment it crashes my macro. And doing sowithout giving an error message.
When I restart the macro I do get the notification about the macropossibly beeing unstable due to a problem on previous playback ...
This is my situation :
I've got 1 macro that has a playbutton on my menubar.
It functions as a "main menu" for my configurator.
The user has 3 options to pick.
Once the desired product is selected, the main macro unloadsitself, and launches a seperate macro designed to configure/drawthe chosen product.
This macro opens an assy, runs (alters dimensions, features etc)then rebuilds the assy.
After this the macro unloads itself and opens the "mainmenu"-macro.
When i choose to do another config/run, it once again unloadsitself , loads the config macro, runs the config macro and does aforceRebuild. Only this time it crashes the VBA and halts all .
There is quite some time between the 2 rebuilds .. i'm not surewhat goes wrong here ..
Any ideas are allways more then welcome !
greets,
BertSolidworksApi macros

In my case at a certain moment it crashes my macro. And doing sowithout giving an error message.
When I restart the macro I do get the notification about the macropossibly beeing unstable due to a problem on previous playback ...
This is my situation :
I've got 1 macro that has a playbutton on my menubar.
It functions as a "main menu" for my configurator.
The user has 3 options to pick.
Once the desired product is selected, the main macro unloadsitself, and launches a seperate macro designed to configure/drawthe chosen product.
This macro opens an assy, runs (alters dimensions, features etc)then rebuilds the assy.
After this the macro unloads itself and opens the "mainmenu"-macro.
When i choose to do another config/run, it once again unloadsitself , loads the config macro, runs the config macro and does aforceRebuild. Only this time it crashes the VBA and halts all .
There is quite some time between the 2 rebuilds .. i'm not surewhat goes wrong here ..
Any ideas are allways more then welcome !
greets,
BertSolidworksApi macros

It sounds to me like you need to better manage your program flow. Iwould recommend that all your code reside in one macro file ratherthan two. If you need to better organize your code, use multiplemodules inside the same file.
Problem is that its getting tough on organising it all.
It all started out as 1 macro, but the several jobs it did allreadywhere using several methods ..
i've added a simple diagram (in attachment) on how it "works" now.
But i think you're right, i'll have to go back and put it in 1macro, and reorganise it to bits !
I agree, use msgbox, or pass boolean return to check the macrosloaded or not.
You might try using VSTA rather that VBA. I'm no expert, but Ithink that it does a better job sequencing things. I've hadproblems with VBA and solidworks events that VSTA fixed--theseshowed up with swx2009 64.
-Jason S.