BookmarkSubscribeRSS Feed
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:


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






  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 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.






Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

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.

Get the $99 certification deal.jpg



Back in the Classroom!

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

View all other training opportunities.

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