BookmarkSubscribeRSS Feed
slpinnnell
Calcite | Level 5

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:

slpinnnell_1-1685134234838.png

This is what I'd like hyperlinks to look like after they've been followed (first subject) :

slpinnnell_3-1685134359303.png

 

 

2 REPLIES 2
Cynthia_sas
SAS Super FREQ

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:

Cynthia_sas_0-1685288016215.png

  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: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

How to Concatenate Values

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.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 2 replies
  • 478 views
  • 1 like
  • 3 in conversation