I have a macro as attached that runs the command to check the file lock status. It works sometime. But it fails frequently.
The error message is: The external program "c:\windows\system32\cmd.exe" returned an error code: 1
I have tried to run the BAT file manually created from this workflow and it worked each time. So I don't know what is causing the error.
I added below code in the Arguments and then see in the log.txt file this message: Access is denied.
> %temp%\log.txt 2>&1
@JokeFun
Your run command configuration is somehow different with I usually do.
So I have modified and it seems works alright for a few times.
I output the bat file first to user temp folder, which should have no concern for permission issues.
then read back to execute it.
Hi @Qiu , Thanks! I tried yours and it worked. Actually I have tried the similar setting as well but not working (always). So just now I closed all my workflows and have the macro re-opened. This time it worked again. But then I go to the Application where this macro is used and run it in the designer, oops, it failed again.
@JokeFun
Sorry to hear that.
I can not see where will be the issue unless I have the whole picture.
Wish you good luck, 😁
User | Count |
---|---|
107 | |
82 | |
70 | |
54 | |
40 |