View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Bob[_65_] Bob[_65_] is offline
external usenet poster
 
Posts: 2
Default using the clipboard to avoid VBA / Interop

It is now standard practice of mine, when creating an Excel document
programmatically, to simply create an .xls filename and the invoke it
directly with a shell command. Regardless of the version of Excel the user
might have or where it's installed, if it's on the machine it will grab the
file because of the .xls extension, and then I can simply copy tab-delimited
data to the clipboard and paste it into the sheet - keeping my application
can remain completely agnostic of Excel.

So my question is, I would like to be able to have this tab-delimited data
be able to contain carriage returns in individual cells (right now I replace
them with spaces). I can't figure out if this is possible with just cut and
paste, however, as CR is a row delimiter.

If that's not possible, could someone point me to a reliable example of
direct Excel file creation? Again, I want to avoid any DLL reference to
Excel components if at all possible. I probably want to support all the way
back to Office 95.

TIA,
Bob