1
votes

Is it possible using SAS to export an Microsoft Excel formatted file that uses Excel's built in conditional formatting? I know I can use Proc Report computational sets to change formats, and I can use the ExcelXP tagset to control colors, but I need to use Excel's built in Conditional formatting, not just setting the format in SAS.

2
Using DDE you probably can, but I wouldn't want to try it :)Reeza
If you use a pre-formatted excel sheet you can export to it and it will maintain the conditional formatting. Proc export or the macro here are useful sascommunity.org/mwiki/images/f/f4/1793-2014.sasReeza
@Reeza - you should enter that as an answer so it can be accepted.Robert Penridge

2 Answers

1
votes

If you use a pre-formatted excel sheet you can export to it and it will maintain the conditional formatting. Proc export or the macro here is useful http://sascommunity.org/mwiki/images/f/f4/1793-2014.sas

Or if you need some sort of dynamic control could write a VB script that then gets called via DDE but also way too complicated IMO.

1
votes

Short of Reeza's suggestion (ie. actually using excel to do the conditional formatting) there is no supported way to do this.

We had to do this for our web-based reporting, and we ended up writing our own conditional formatter (in jQuery). It applies excel-like conditional formatting because despite our best efforts we couldn't figure out exactly how the excel conditional formatting algorithm works (it has some quirks). I don't think anyone would ever notice the difference though.

I've entered this as a suggestion in the SAS software ballot. I'll edit this post and share the link if the idea gets 'approved'.

EDIT : You can vote here . Voting will require a login to the SAS website.