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: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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