This content is not available in your preferred language.

The content is shown in another available language. Your browser may include features that can help translate the text.

Error 5906 Invalid File Handle in DIAdem

Updated Aug 8, 2022

Reported In

Software

  • DIAdem

Issue Details

I am trying to write to a file using a script in DIAdem, however I get the following error when it executes:

Error number: 5906
The specified file handle is invalid

5906 error

Solution

The file reference is not being properly created, so the error will be reported once the script tries to write to the file.

This can happen if you are trying to create the file in the root of the C:\ drive, without having the proper permissions to do so. In this case you can avoid the error by:
  • Launching DIAdem as administrator and then execute the script.
  • Change the location of the file elsewhere where your user has permissions to write, for example to your user's Desktop or Documents folder.

Additional Information

For the error message to be shown you need to use error handling in the script, you can refer to the DIAdem's help page for more information. The TextFileError and TextFileErrorTxt functions can be used to display information about text files errors.