Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations GregLocock on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Fail to Run Macro

Status
Not open for further replies.

MadMango

Mechanical
May 1, 2001
6,992
I'm using SW01+, SP1.2, been on this for the last 6 months or so. We have a macro that populates the Custom Properties in SW parts, assys and drawings. This has been working fine up till yesterday. As far as I know, nothing has been done or altered in any way to our network or my compuer. Now for some reason, when I run the macro I get the following error:

"A serious error occured during macro playback. Perhaps the macro was not played in the correct context. The system could be in an unstable state now."

Or if I'm lucky, I'll get this error messege:

&quot;Cannot open <file path to custom macro.swp>.&quot;

Has anyone seen this? I want to try some other routes before I resort to doing a reinstall on SW. &quot;The attempt and not the deed confounds us.&quot;
 
Replies continue below

Recommended for you

MadMango,
Yes this has happened to us when I.S. replaced our server. Everything was named the same, all but one macro worked. What I did was opened the macro.swp and made sure that the path was right. Then I opened the Visual Basic executable, made sure everything was correct, recompiled it and saved it to the network. Rebooted the computer and the macro worked. Still to this day, I do not know what went wrong.
Bradley
 
Thanks for the reply Bradley. I've been the route of ensuring the macro file path hasn't changed. I even went as far as to save the macro locally on my hard drive. I'm not a programmer, so I guess I'll have ours double check this macro, though I doubt anything is wrong with it. Seems that I am the only one having trouble running this macro, everyone else is in hog heaven. &quot;The attempt and not the deed confounds us.&quot;
 
Is the macro located on a network server? If this server is mapped to a specific drive on your machine and the connection or mapping is lost this could be the problem. I often see this happen with NT4.

Is this the only macro affected? Can you use other macros if they are on the hard drive? If not I suspect a corrupt SWX or VBA installation.
 
I copied the macro to my local drive and likewise, I changed my refernce path.

It seems I can run other &quot;simpler&quot; macros, ones that I have made via Record Macro feature. The macro I am having trouble with is one that was created with VB6. It was working fine before, and I am trying to understand what could have happended to make it not work. &quot;The attempt and not the deed confounds us.&quot;
 
MadMango,
Take a look inside the Visual Basic program to see if the program is calling something that is not located within your view. If everything is OK there, have SolidWorks running and double click on the Visual Basic program from within Explore. Bradley
 
For what it's worth, it was just a few days ago that I, too, ran into that message

(&quot;A serious error occured during macro playback. Perhaps the macro was not played in the correct context. The system could be in an unstable state now.&quot;)

I had just created a macro that, when a VBA listbox item was clicked, updated a sketch in a ModelDoc. Only when I repeatedly clicked quickly on the different list items (and cause cascading regens of the model) did i get this message.

So, rightly, or wrongly, I attributed the message to some sort of 'flood' of API calls.
 
We've tried a reinstall of VBA with no success. We've tried a reinstall of SW with no success. Now I have sent the macro on to my VAR and will keep everyone posted on their findings. &quot;The attempt and not the deed confounds us.&quot;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor