I have a problem: I want to run a file from lotusscript code:
Dim result As Integer
result = Shell("D:\testF.dsx", 1)
And I get the following error: Illegal function call.
If I want to execute it from formula it works:
@Command([Execute]; "D:\\testF.dsx")
Thanks a lot!
It is not possible to "Execute" a Textfile. usually there is no "run" function defined for dsx- files.
You could do it like:
Or find out, which program is linked to dsx (via registry) and execute the corresponding exe with filename as Parameter. If the filename contains spaces, then it has to be enclosed:
And reading your last question this approach for sure is NOT the right for your request. You have to use "open" in order to process files... Like Per Hendrik told you in his response.
I had similar problems passing parameters to Outlook. On some windows machines, this @Formula worked perfectly:
On Windows Terminal Servers, it caused Outlook to be unable to parse the "/recycle" The Shell-command from LotusScript wasn't even able to locate the Outlook.exe, as it was not in the PATH.
Ralf's code helped me in this respect. The "WScript.Shell" seems able to interact with Windows registry settings. Anyway, here is the code that works for activating an open Outlook window.
I had the same problem with the shell function in lotus script with PDF files. And my workaround is to use the windows scripting host to launch the file. I am pretty sure this will solve your problem too.