@Craig DIckson, I am attaching pathsexample.zip as a simple example of how I would use relative paths with the Excel Import/Export functions using the Import tab as well as the Custom Export in the Custom tab. The model is kept in a folder called model and both the input and output Excel files are kept in a folder called data. As long as both of those folders are kept in the same directory, the model should work.
It sounds like you've gotten the Excel Import/Export tabs to work with relative paths, but in the model, the Imports tab is using a relative path. If you click on the Import Tables button, the Inputs Global Table should be populated with the data from Inputs.xlsx.
In the Custom Export section of the Custom tab, there is sample code (which should also open with the model) that is using the concat() command, the modeldir() command, and a string with the relative path to Outputs.xlsx that set up the filename variable which is immediately used with the excelopen() command. The excelexporttable() command is then used to export the Outputs Global Table to Outputs.xlsx.
I am interested to know if this model runs fine on your computer or not. And if it does run fine, then the issue with your model might be how the Custom Export code is set up or perhaps something with Excel that is causing issues.
The first error message in your last reply seems to indicate there is already an opened Excel workbook and FlexSim tried to close the workbook before your call to
excelopen(concat(modeldir(), "..\\Data\\Outputs.xlsx"));
But, there was an error when trying to close it. Is Excel closed while you are trying to run the custom export code? Is there other code before excelopen() is called? Or have you already opened an Excel workbook somewhere else in the model without closing it?