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.
"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
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
"The attempt and not the deed confounds us."
RE: Fail to Run Macro
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
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
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
("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
"The attempt and not the deed confounds us."