07-13-2015 09:31 AM
I was wondering if there is a way to use proc export to place data in a particular row and column in Excel. I know that proc import can access a row and column, but I have not found anything for proc export.
07-13-2015 09:43 AM
First recommendation, don't use proc import/export - they are guessing procedures.
Second point, what exactly is in the spreadsheet your trying to change, Excel is not a good tool for anything, but especially data. With SAS you *could* use DDE (which is very old tech and not recommended), you could libname excel to the file, and set cell values there. However if I really had to do this (and I would really not be happy with using Excel for anything other than management toy), I would export the values to be updated into a CSV file from SAS. Then in the spreadsheet I wanted to change I would write some VBA code to open the CSV, and copy the data items to specific cells. VBA is very simple and there are plenty of examples online for doing this.
07-13-2015 09:48 AM
Simply, I wanted to places tables next to each other. Nothing major. But, if this is complex, I have something else lined up. I just wondered if it was possible.
07-13-2015 09:54 AM
Ah, well that's different. Use tagsets.Excelxp:
ods tagsets.excelxp file="xyz.xml" options=(sheet_interval="none" sheet_name="mydata");
proc report data=xyx...;
proc report data=zyz...;
ods tagsets.excelxp close;
07-13-2015 11:04 AM
The tables are stacked. Below is the concept that I am looking at. I guess I will have to rely on VB. I was hoping that it would be possible in SAS.
07-13-2015 10:57 AM
There isn't an easy way, but there are other ways to get your data to excel and have it look presentable.
If you absolutely need to link to specific cells, VB is a good way to go.
ODS TAGSETS and EXCEL are two options.
Need further help from the community? Please ask a new question.