The cause of this error is that the LabVIEW Runtime Engine, which is used to run executable files built using LabVIEW, does not support creating or modifying VIs.
While modifying VIs is not possible to do with the LabVIEW Runtime Engine alone, there is a work around available in the case that the application is intended to run on a computer with the LabVIEW Development System already installed.
- Enable TCP / IP in the VI server settings and note the port that is being used. (LabVIEW > Tools > Options > VI Server)
- Open an application reference to an instance of LabVIEW on the local machine.
- Open a reference to the VI that wish to modify and save at runtime using the LabVIEW application reference created in step 3.
- Add code to modify and save the VI by reference.
- Don't forget to close the LabVIEW application reference and VI reference when they are no longer needed.
When finished, your code should look something like the following.