Hello all.
I have a macro that loops through all the segments in a sketchusing
intItemCount = 0
Do While Not strSegID(intItemCount) = ""
.................
Loop
This works fine when I step the macro through using F8 but when Irun the macro properly the macro alarms out with a "subscript outrange" error. If I put a macro break in at "intItemCount = 0", thenresume the macro, every thing works fine. It appears to me that theonly explanation is VBA is running too fast for SolidWorks to keepup (though I am sure that this is fanciful!). What can I do to getmy macro running properly? Is there a command in VBA to force theprocess to wait for X milliseconds? Has anyone come up against thisbefore?
Many thanks
BobSolidworksApi macros
I have a macro that loops through all the segments in a sketchusing
intItemCount = 0
Do While Not strSegID(intItemCount) = ""
.................
Loop
This works fine when I step the macro through using F8 but when Irun the macro properly the macro alarms out with a "subscript outrange" error. If I put a macro break in at "intItemCount = 0", thenresume the macro, every thing works fine. It appears to me that theonly explanation is VBA is running too fast for SolidWorks to keepup (though I am sure that this is fanciful!). What can I do to getmy macro running properly? Is there a command in VBA to force theprocess to wait for X milliseconds? Has anyone come up against thisbefore?
Many thanks
BobSolidworksApi macros