BookmarkSubscribeRSS Feed
deleted_user
Not applicable
Is it possible with SAS code to update specific cells in an already existing Excel worksheet?

Let's say I have values in cells A1 and B1 in the worksheet. In a SAS program I have a new value for B1. I want to update the cell B1 with the new value, without affecting the existing value in cell A1.

Is that possible with SAS code?

If yes, can you give me a link to a description of a solution to the problem, or maybe you could tell me how.

(In the real situation it's not only two cells, but hundreds, and some should be updated and others should keep their values.)
3 REPLIES 3
deleted_user
Not applicable
might be better to pull values into excel rather than push from SAS.
The only tool suitable for push is (I think) DDE, and this is not encouraged.
For "pull" excel supports a "web query" on "data" menus. Your "pull" example would be no more complex than using excel to parse the information in an html file you create directly from SAS. Of course, as a "web query" you need the excel environment to refresh the data.

good luck

PeterC
LinusH
Tourmaline | Level 20
Another option is to treat the Excel file more in a DB way. By using LIBNAME excel, you can use standard SAS techniques for updating data in the spread-sheet (data step or SQL UPDATE). This could be the best way to do it if you have some kind of id-column.

/Linus
Data never sleeps

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

Discussion stats
  • 3 replies
  • 854 views
  • 0 likes
  • 2 in conversation