I've created a script tool that has an optional output parameter of an Excel Workbook. If it's populated, the script will add a new worksheet. However, every time the tool is run, ArcGIS is somehow deleting the existing workbook.
I've tested it, and this happens even with a script that does nothing but pass and with a validation class that only bypasses the warning that output file already exists (self.params[0].clearMessage()
).
I could optionally set it as an input parameter, but I don't want to require that the file already exists. My script will create the workbook if it doesn't already exist.
I simply want the path/name of a workbook that may or may not already exist and to which the user would like to add a worksheet.
The parameter's "direction" property is read-only, so I can't even use some convoluted logic in the validation class to change the direction of a parameter.
Is there some way to set a directionless parameter?
An example script with which this happens:
pass
Yes, that's all of it. One word; 4 letters.
As I tried to explain before, the script hasn't even started to execute when Esri--somewhere behind the scenes--deletes any datasets that are set as output parameters.
The issue is with Esri's script tool, not with the script itself.