Community Tip - Learn all about the Community Ranking System, a fun gamification element of the PTC Community. X
How do I use the CWD path in WRITEEXCEL command
There is already a backslash at the end of the string "Dir" so you have to omit it when using that variable in WRITEEXCEL.
Furthermore "Dir" already IS a string which you want to concat with the file name, so you should write
WRITEEXCEL(concat(Dir,"A.xlsx"),Data)
I am not sure what you intended with the last two arguments (1,1)? If you meant that the "Data"-Matrix should be written with the top left value in cell A1, then you don't need to tell Prime so as this is the default. If you want to use that range argument, you would have to provide a string as third argument -> "A1".
You can also specify which sheet of a multi-sheet Excel file the data should be written to. You may want to lookup the syntax for WRITEEXCEL in the help.