I recently upgraded MS to the latest version 15 and modified part of one of these, but not the create directories or WriteLn subroutines. Now my text files are locked for editing or deletion, even long after the .exe macro has closed. The error says "File is open in another program", even when I'm the only user in the network and the macro/process is validated as closed. Only when I restart the local machine are the text files unlocked.
Here's the interesting note; On this same computer there is a parallel .exe Macro that runs for a minute which also was originally compiled in MS 14, and has not yet been modified in MS 15. Those text files write to the same network folder and are not locked. Both macros have a similar WriteLn function.
When I run the un-compiled macro from the Editor, it creates a normal unlocked text file on the same network folder.
The WriteLn function that suddenly creates locked files is as follows:
Code: Select all
Label>RepeatGrab
Wait>1
Press CTRL
Send>a
Release CTRL
Wait>.3
Press CTRL
Send>c
Wait>.3
Release CTRL
GetClipBoard>MyScreen,0
Length>%MyScreen%,nLength
If>%nLength%=0,RepeatGrab
Let>MyPath=%RootPath%\PrtInqry-%PFile%.txt
WriteLn>MyPath,WLN_Res,MyScreen"
I have added a WLN_Res which messages me a code: 32 although the content of the txt file seem to be written successfully.
The Database that tries to read, manipulate or delete these txt files returns an error 70 or 3051
Why is there a sudden difference with the macro compiled in MS 15?
What am I missing?