BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
TashaBee
Fluorite | Level 6

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.

1 ACCEPTED SOLUTION
8 REPLIES 8
RW9
Diamond | Level 26 RW9
Diamond | Level 26

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.

TashaBee
Fluorite | Level 6

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.

Thanks,

RW9
Diamond | Level 26 RW9
Diamond | Level 26

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;

TashaBee
Fluorite | Level 6

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.

Capture.JPG

Ksharp
Super User

Libname + excel and change the cell via data step, just like it is a sas dataset ?

Reeza
Super User

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.

Base SAS: Demo: ExcelXP Tagset and Microsoft Excel

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 8 replies
  • 11971 views
  • 2 likes
  • 4 in conversation