×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Fail to Run Macro

Fail to Run Macro

Fail to Run Macro

(OP)
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:

"Cannot open <file path to custom macro.swp>."

Has anyone seen this?  I want to try some other routes before I resort to doing a reinstall on SW.

"The attempt and not the deed confounds us."

RE: Fail to Run Macro

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

RE: Fail to Run Macro

(OP)
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.

"The attempt and not the deed confounds us."

RE: Fail to Run Macro

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.

RE: Fail to Run Macro

(OP)
I copied the macro to my local drive and likewise, I changed my refernce path.

It seems I can run other "simpler" 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.

"The attempt and not the deed confounds us."

RE: Fail to Run Macro

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

RE: Fail to Run Macro

For what it's worth, it was just a few days ago that I, too, ran into that message

("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.")

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.

RE: Fail to Run Macro

(OP)
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.

"The attempt and not the deed confounds us."

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources