SAS Office Analytics, SAS Add-In for Microsoft Office, and other integrations

Updating specific cells in an already existing Excel worksheet.

Reply
N/A
Posts: 0

Updating specific cells in an already existing Excel worksheet.

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.)
N/A
Posts: 0

Re: Updating specific cells in an already existing Excel worksheet.

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
Esteemed Advisor
Posts: 5,194

Re: Updating specific cells in an already existing Excel worksheet.

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
N/A
Posts: 0

Re: Updating specific cells in an already existing Excel worksheet.

What do you think of %exportToXL?

http://exporttoxl.sourceforge.net/
Ask a Question
Discussion stats
  • 3 replies
  • 242 views
  • 0 likes
  • 2 in conversation