With ODS Excel (SAS version 9.4), I'm able to successfully create hyperlinks to individual subject tabs within my Excel spreadsheet with the following code:
proc report data = subjects split = "`"; columns subject;
define subject / "Subject" style(column) = {textdecoration = underline foreground = blue}; compute subject; urlstring = "#'" || strip(subject) || "'!A1"; call define (_col_, 'url', urlstring); endcomp; run;
The hyperlinks are even blue underlined by using the style options for the SUBJECT column. Is there a way to format these hyperlinks in the Excel file so that they change color after they have been followed, similar to what Excel would do if the Hyperlink style was applied?
Here's what my current Excel file looks like:
This is what I'd like hyperlinks to look like after they've been followed (first subject) :
Maybe @Cynthia_sas knew it !
Hi:
ODS HTML supports 2 style attributes: ACTIVELINKCOLOR and VISITEDLINKCOLOR, but they only sort of work in HTML output and don't work in other destinations. I doubt they will work in ODS EXCEL, since OSD is creating is a proprietary MIcrosoft XML format.
This YouTube video https://www.youtube.com/watch?v=qufMuSNkLYM seems to indicate that changing hyperlink colors in Excel involves changing a Microsoft theme, as shown in this screen snippet from the video:
I don't know whether a Microsoft theme can be implemented or translated to an ODS style template. And IF some of a theme can be implemented in an ODS style template (a big IF), I don't know whether hyperlink colors is one of the changeable attributes. ODS documentation still lists ACTIVELINKCOLOR and VISITEDLINKCOLOR as being ODS HTML style attributes. So, I think that these would be questions better addressed with SAS Tech Support.
Cynthia
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.