Skip to main content
9-Granite
July 11, 2022
Question

How can use path in writeexcel function

  • July 11, 2022
  • 1 reply
  • 906 views

How do I use the CWD path in WRITEEXCEL command 

 

TR_9781963_0-1657571591469.png

 

1 reply

25-Diamond I
July 11, 2022

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.