cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Unpredictable macro crash

Level 8

Unpredictable macro crash

Hello everyone,

I'm facing a complex and apparently insoluble problem with macro execution.

The code is launched by a Visual Basic Sendkeys instruction from another application and does the following actions:

- Reads data from a text file and stores them into an LTAB;

- Deletes the text file;

- Sets a part name; check if already exists, deletes it, creates a new part with that name;

- Draws a table starting from 0,0 and fills it with stored data;

- Adds all data as Info to the part;

- Prints a pdf file of the table;

- Deletes the table heading text;

- Goes to Top, executes a Modify Move action taking the table and leaving it hanging to the mouse pointer.

Everything worked fine on seven Workstations for about ten years; a couple of months ago it began giving problems on one single PC (which is the same as mine): the code hangs or ends in a random looking way.

From time to time it fails before deleting the existing table, deletes it and ends, begins filling the table and ends after a variable number of records, hangs at the attribution of Info, finishes before printing pdf.

In normal executions, it never reaches the Modify instruction; instead, setting up a Breakpoint, the step-by-step running succeeds without issues.

Since we needed to replace another Workstation, we decided to buy the new one for this user and set it up without cloning the disk to solve the problem; well, the new WS has the same problem.

I tried inserting multiple Wait instructions to give the interpreter some time to reflect with no success.

Has anyone experienced such problems?

Thank you

Marco

Tags (1)
2 REPLIES 2

Re: Unpredictable macro crash

Do all of the stations receive updates?  My thought, is that  this is a Microsoft related issue with an update to visual basic.

 

Perhaps going to an older version of visual basic would fix this issue?

 

Tom

 

Highlighted

Re: Unpredictable macro crash

Thank you for the attention Tom.

First, I was not clear enough: there is an .exe program, likely not suffering from any Microsoft update, inputting MYMACRONAME plus parameters in the Drafting command line and entering the input.

All the actions described in my original post are executed by MYMACRONAME, written in MI language.

We have seven workstations, both Win10 and Win7, regularly updated, all equipped with Direct Drafting 19.0 and all but one are running MYMACRONAME correctly. Same behavior with the macro running under Drafting 18.1.

Failing other solutions, my next action will be to write down the code starting from zero and see if changes resulting from experience can fix the problem.

Thanks once again

Marco