Why does an auto-save Macro only work on the computer it was written on?

This is an advanced Solution.

In most cases, Macros can be seamlessly transferred from one machine to another without any loss of functionality. However, if the saving of a document is written into a Macro, the Save will only work on the Computer and User Account the Macro was originally written on.

This is due to the Save protocol, including the file path for the save, which is tied to the computer the Macro was written on (specifically the User Account). For example, if your User Account is John, the code for the auto-save might look like this if the LabChart file is saved to Documents:

Call Doc.SaveAsAdvanced ("C:\Users\John\Desktop\Documents\Example.adicht", "{FA80FC3E-8409-4053-BEB7-1ACE168EE24F}-0", 2)

In this case, if you run the Macro on another computer/user account, you will either get an error indicating the save failed, or the file will simply not be saved. To resolve this, change the User Account in the Macro code (in bold above) to the User Account you want to run this code on.

For example, if you want to amend the above Macro to run on your Jane User Account, open the Macro code by going to Macro | Manage | Edit, and replace the 'John' with 'Jane':

Call Doc.SaveAsAdvanced ("C:\Users\Jane\Desktop\Documents\Example.adicht", "{FA80FC3E-8409-4053-BEB7-1ACE168EE24F}-0", 2)

Alternatively, record a separate Macro in LabChart on the new computer and copy and paste the resulting saving code into the Macro imported from the other computer.

Whenever editing / transferring a Macro involving autosaving, it is important to test the modified Macro to ensure data is saved correctly, before doing any meaningful recordings.

This information is valid for Windows 8, 10 & 11.

For further technical assistance with this or any other issue, please contact ADInstruments Technical Support by clicking HERE