Hi,
First and foremost, please dont code all in upper case, without prpoer indentation, it makes reading the code so much harder.
Secondly, at no point here are you creating a excelxp style tagset output file?
Thirdly, the filename given in the code - spread.xlsb.xls - doesn't seem to make much sense, are you creating:
- an XLS file which is a binary file standard strcuture pre-open office
- an XLSB file which is an open office binary component (i.e macro enabled) document
- an XLSX which is an open office standard Excel file
- or an ods tagset generated XML document which Excel can read
Finally, if your stuck with an Excel file which you need to add data into (and if so your going to end up fighting it for the rest of its existence) then why not switch the thinking around. I.e. You have some data in SAS, you need to load it into Excel. So, export the data from SAS as CSV - simple step. Now in the Excel (or another one, it only needs to hold some code) wriet a small VBA macro which allows you to select a file, opens that file into a new sheet, copies the data over as you want, then deletes the new sheet. Simple, this keeps the Excel file the same as it was, just uses Excel VBA to update. And if your stuck using Excel, why not use its full potential. Lots of examples of how to do this:
http://www.zerrtech.com/content/excel-vba-open-csv-file-and-import
https://msdn.microsoft.com/en-us/library/office/ff840655.aspx
I would not suggest using DDE, its old and may not be supported, plus only has the functionality of the version all the way back then.
... View more