Hello,
For formatting strings to be written to spreadsheets such as excel, see my post in the following thread - it includes an attached example:
Best Regards,
JLS
PS - it does not address writing to a cell which your cursor is in - it uses simple file i/o to write a spreadsheet formatted string/file, and this cannot even be written in this way if you already have the file you are writing to open in another program - usually the program blocks access (and reasonably so) when it opens the file. You can of course write to a file and choose which cell a given piece of data will show up in when you open it in excel... this is just formatting the data correctly, and as you'll see in the thread linked above, this is rather trivial.