<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: ods options for tab_color not working in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/ods-options-for-tab-color-not-working/m-p/552293#M153515</link>
    <description>You'd have to verify the options list but I think everything you've shown is also in ODS EXCEL - and it creates native XLSX files directly, not an XML file. The specification style is pretty much the same so you'd be changing only  ODS TAGSETS.EXCELXP line primarily. The remaining code would be the same. But....I totally get not wanting to refactor working code for such a small issue. My 'lazy approach' would be to write a small VBA macro or VBS to do it...assuming the specifications above don't work.</description>
    <pubDate>Thu, 18 Apr 2019 19:25:48 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2019-04-18T19:25:48Z</dc:date>
    <item>
      <title>ods options for tab_color not working</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ods-options-for-tab-color-not-working/m-p/552265#M153506</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have SAS version 9.4.&amp;nbsp; I am using the tagsets.ExcelXP to export data to an Excel workbook and want to change the tab color.&amp;nbsp; According to items I've read, the option of tab_color('color') should work, allowing for the word of the color i.e. 'green' or the hexadecimal value.&amp;nbsp; Below is my code but the tab_color function doesn't work (everything else does).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I found some code from the SAS website to edit the template and create tagsets.ExcelXP_mod which allows for tabcolor= but it seems to only allow names i.e. 'red', 'green' but not hexadecimal or other descriptions for the color.&amp;nbsp; All assistance greatly appreciated.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options center;
ods listing close;
ods tagsets.ExcelXP path=&amp;amp;T_Path 
file=&amp;amp;F_Name style=printer;
title 'DAD_DQ'; 

/*Worksheet 2 - demographics*/
ods tagsets.ExcelXP options(sheet_name='Demo' Absolute_Column_Width='5,8,8,8,8,12,8,8,8,8'
		Autofit_height='yes' tab_color='green');
proc print data=demo_1 noobs style(Data)=[just=left] style(Header)=[just=center];
var inst;
var chartno;
var acctno;
var disdate;
var coder/style(data)={tagattr='format:@'};
var HCN/style(data)={tagattr='format:@'};
var Postal;
var Rescode/style(data)={tagattr='format:@'};
var ProvIss;
var RFP/ style(data)={tagattr='format:@'};
run; quit;

ods tagsets.ExcelXP close;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 18 Apr 2019 18:54:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ods-options-for-tab-color-not-working/m-p/552265#M153506</guid>
      <dc:creator>shellp55</dc:creator>
      <dc:date>2019-04-18T18:54:54Z</dc:date>
    </item>
    <item>
      <title>Re: ods options for tab_color not working</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ods-options-for-tab-color-not-working/m-p/552270#M153507</link>
      <description>How are you specifying the colours? Usually they're specified as CXFFFFFF with the CX in front. Not sure if you need to use SAS specifications here or excels though...&lt;BR /&gt;&lt;BR /&gt;Do you have a link to the website where you got the code?</description>
      <pubDate>Thu, 18 Apr 2019 18:57:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ods-options-for-tab-color-not-working/m-p/552270#M153507</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-04-18T18:57:05Z</dc:date>
    </item>
    <item>
      <title>Re: ods options for tab_color not working</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ods-options-for-tab-color-not-working/m-p/552276#M153509</link>
      <description>&lt;P&gt;Hey Reeza, thanks for responding!&amp;nbsp; The code was from &lt;A href="http://support.sas.com/kb/45/addl/fusion_45249_1_tabcolor.sas.txt" target="_blank"&gt;http://support.sas.com/kb/45/addl/fusion_45249_1_tabcolor.sas.txt&lt;/A&gt; but I've also provided below:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc template;
      define tagset tagsets.ExcelXP_Mod;
       parent=tagsets.excelxp;
  
       define event tabcolor;
         set $tabcolor $options['TABCOLOR'];

         set $tab_color["black" ] "0";
         set $tab_color["white" ] "1";
         set $tab_color["red" ] "2";
         set $tab_color["green" ] "3";
         set $tab_color["blue" ] "4";
         set $tab_color["yellow" ] "5";
         set $tab_color["magenta" ] "6";
         set $tab_color["cyan" ] "7";
         set $tab_color[]  lowcase($options['TABCOLOR']);

         do / if $tab_color[$tabcolor];
            put "&amp;lt;x:TabColorIndex&amp;gt;" $tab_color[$tabcolor];
         else;
            put "&amp;lt;x:TabColorIndex&amp;gt;" $tabcolor;
         done;
            put "&amp;lt;/x:TabColorIndex&amp;gt;" NL /if $tabcolor;
         done;
      end;

       define event worksheet;
          start:

          do /if ^$doing_blank;

             trigger do_blank_worksheet /if $blank_sheet_name;
          done;

           trigger get_global_margins;

           do /if $proclist[proc_name];
              putlog "Excel XML does not support output from Proc:"
                      proc_name;
              putlog "Output will not be created.";
              break;
           done;

            break /if $worksheet_started;
            unset $cellwidths;
            unset $worksheet_widths;
            unset $worksheet_has_panes;
            unset $worksheet_has_autofilter;
            unset $worksheet_has_titles;
            unset $possible_row_repeat_start;
            unset $possible_row_repeat_end;
            unset $possible_col_repeat_start;
            unset $possible_col_repeat_end;

            do /if ^$worksheet_row;
                 eval $worksheet_row 0;
             done;

             eval $numberOfWorksheets $numberOfWorksheets +1;
             trigger worksheet_label;
             trigger clean_worksheet_label;
             trigger contents_entry /if ^cmp( event_name, "byline");

            do /if cmp( $worksheetname, " ");
                  eval $numberOfWorksheets $numberOfWorksheets -1;
             done;

             do /if $debug_level = -8;
                putlog "!!!!!!!!" Event_name "  Worksheet: |" $
                           worksheetname "|  " $numberOfWorksheets;
             done;
             unset $$worksheet_start;
             open worksheet_start;
              put "&amp;lt;x:WorksheetOptions xmlns=""urn:schemas-microsoft-com
:office:excel""&amp;gt;" NL;

             do /if $fittopage;
                     put "&amp;lt;FitToPage /&amp;gt;" NL;
             done;
             put "&amp;lt;Print&amp;gt;" NL;
             put "&amp;lt;ValidPrinterInfo/&amp;gt;" NL;
             trigger do_paperSize;

             do /if $scale;
                 put "&amp;lt;Scale&amp;gt;";
                 put $scale;
                 put "&amp;lt;/Scale&amp;gt;" NL;
             done;

                  put "&amp;lt;FitWidth&amp;gt;" $pages_fitwidth "&amp;lt;/FitWidth&amp;gt;" NL;
                  put "&amp;lt;FitHeight&amp;gt;" $pages_fitheight "&amp;lt;/FitHeight&amp;gt;" NL;
                  put "&amp;lt;LeftToRight/&amp;gt;" NL /if $left_to_right;
                  put "&amp;lt;HorizontalResolution&amp;gt;";
                  put $print_dpi;
                  put "&amp;lt;/HorizontalResolution&amp;gt;" NL;
                  put "&amp;lt;VerticalResolution&amp;gt;";
                  put $print_dpi;
                  put "&amp;lt;/VerticalResolution&amp;gt;" NL;
                  put "&amp;lt;Gridlines/&amp;gt;" NL /if $gridlines;
                  put "&amp;lt;BlackAndWhite/&amp;gt;" NL /if $blackandwhite;
                  put "&amp;lt;DraftQuality/&amp;gt;" NL /if $draftquality;
                  put "&amp;lt;RowColHeadings/&amp;gt;" NL /if $RowColHeadings;
                  put "&amp;lt;/Print&amp;gt;" NL;
                  trigger tabcolor;
                  put "&amp;lt;Zoom&amp;gt;" $Zoom "&amp;lt;/Zoom&amp;gt;" NL /if $Zoom;
                  put "&amp;lt;PageLayoutZoom&amp;gt;" $PageLayoutZoom "&amp;lt;/PageLayoutZoom&amp;gt;"
                        NL /if $PageLayoutZoom;
                  put "&amp;lt;x:PageSetup&amp;gt;" NL;
                  put $$page_setup;

                  do /if ($embedded_titles &amp;amp;  ^ $system_title_setup) |  ^ $
                           system_title_setup;

                     do /if $print_header &amp;amp;  ^ $xheader;
                        putq "&amp;lt;x:header x:Data=" $print_header;
                        putq " x:Margin=" $print_header_margin;
                        put "/&amp;gt;" NL;
                        unset $xheader;
                     done;

                  done;

                  unset $system_title_setup;

                  do /if ($embedded_footnotes &amp;amp;  ^ $system_footer_setup) |  ^
                           $system_footer_setup;

                     do /if $print_footer &amp;amp;  ^ $xfooter;
                        putq "&amp;lt;x:Footer x:Data=" $print_footer;
                        putq " x:Margin=" $print_footer_margin;
                        put "/&amp;gt;" NL;
                        unset $xfooter;
                     done;

                  done;

                  unset $system_footer_setup;

                  do /if any( $landscape, $center_horizontal, $center_Vertical
                           );
                     put "&amp;lt;Layout";
                     put " x:Orientation=""Landscape""" /if $landscape;
                     put " x:CenterHorizontal=""1""" /if $center_horizontal;
                     put " x:CenterVertical=""1""" /if $center_vertical;
                     put "/&amp;gt;" NL;
                  done;


                  do /if any( $marginbottom, $marginleft, $marginright, $
                           margintop);
                     put "&amp;lt;PageMargins";
                     putq " x:Bottom=" $marginbottom;
                     putq " x:Left=" $marginleft;
                     putq " x:Right=" $marginright;
                     putq " x:Top=" $margintop;
                     put "/&amp;gt;" NL;
                  done;

                  put "&amp;lt;/x:PageSetup&amp;gt;" NL;
                  close;

                  open worksheet;
                  set $worksheet_started "True";

               finish:
                  break /if $proclist[proc_name];
                  break /if ^$worksheet_started;
                  unset $worksheet_started;

                  do /if ^$$worksheet;

                     do /if ^$doing_blank;

                        do /if ^cmp( $worksheetname, " ");
                           eval $numberOfWorksheets $numberOfWorksheets -1;
                        done;

                        break;
                     done;

                  done;


                  trigger write_contents_entries;

                  trigger worksheet_tab;
                  unset $tabname_is_done;

                  open master_worksheet;
                  putq "&amp;lt;Worksheet ss:Name=" $worksheetName "&amp;gt;" NL;

                  trigger print_repeats;
                  set $current_worksheet $worksheetName;
                  unset $tempWorksheetName;
                  unset $worksheetName;
                  put $$worksheet_start;
                  unset $$worksheet_start;

                  trigger worksheet_head_end;

                  trigger table_start;
                  put $$worksheet;
                  putl "&amp;lt;/Table&amp;gt;";
                  eval $table_count 0;
                  unset $$worksheet;
                  unset $byGroupLabel;
                  putl "&amp;lt;/Worksheet&amp;gt;";
                  eval $worksheet_row 0;
              end;            
           end;   
      run;


&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 18 Apr 2019 19:03:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ods-options-for-tab-color-not-working/m-p/552276#M153509</guid>
      <dc:creator>shellp55</dc:creator>
      <dc:date>2019-04-18T19:03:35Z</dc:date>
    </item>
    <item>
      <title>Re: ods options for tab_color not working</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ods-options-for-tab-color-not-working/m-p/552280#M153511</link>
      <description>So, when that code was generated I'm pretty sure there was a smaller list to set the colours. In the newest version of Excel you can use any colour. &lt;BR /&gt;&lt;BR /&gt;Try using the same specification as in ODS EXCEL? Can you switch to ODS Excel instead actually?&lt;BR /&gt;&lt;BR /&gt;	&lt;BR /&gt;ods excel options (tab_color='red');&lt;BR /&gt;ods excel options (tab_color='#ff0000');&lt;BR /&gt;ods excel options (tab_color='rgba(0,100%,0,0.5)';&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://documentation.sas.com/?docsetId=odsug&amp;amp;docsetTarget=p09n5pw9ol0897n1qe04zeur27rv.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en" target="_blank"&gt;https://documentation.sas.com/?docsetId=odsug&amp;amp;docsetTarget=p09n5pw9ol0897n1qe04zeur27rv.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en&lt;/A&gt;</description>
      <pubDate>Thu, 18 Apr 2019 19:07:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ods-options-for-tab-color-not-working/m-p/552280#M153511</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-04-18T19:07:45Z</dc:date>
    </item>
    <item>
      <title>Re: ods options for tab_color not working</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ods-options-for-tab-color-not-working/m-p/552285#M153512</link>
      <description>&lt;P&gt;I have 50 sheets written with tagsets.ExcelXP so it might be a bit of work but how different is the syntax for Excel different&amp;nbsp;from the tagsets?&amp;nbsp; For this particular project, tab color is not at all&amp;nbsp;important and it is probably faster to do manually than to do via SAS but I've been bugged about this feature for awhile now and darn it I want tab colors to change!!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks again Reeza!&lt;/P&gt;</description>
      <pubDate>Thu, 18 Apr 2019 19:13:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ods-options-for-tab-color-not-working/m-p/552285#M153512</guid>
      <dc:creator>shellp55</dc:creator>
      <dc:date>2019-04-18T19:13:08Z</dc:date>
    </item>
    <item>
      <title>Re: ods options for tab_color not working</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ods-options-for-tab-color-not-working/m-p/552293#M153515</link>
      <description>You'd have to verify the options list but I think everything you've shown is also in ODS EXCEL - and it creates native XLSX files directly, not an XML file. The specification style is pretty much the same so you'd be changing only  ODS TAGSETS.EXCELXP line primarily. The remaining code would be the same. But....I totally get not wanting to refactor working code for such a small issue. My 'lazy approach' would be to write a small VBA macro or VBS to do it...assuming the specifications above don't work.</description>
      <pubDate>Thu, 18 Apr 2019 19:25:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ods-options-for-tab-color-not-working/m-p/552293#M153515</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-04-18T19:25:48Z</dc:date>
    </item>
    <item>
      <title>Re: ods options for tab_color not working</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ods-options-for-tab-color-not-working/m-p/552308#M153518</link>
      <description>&lt;P&gt;Thanks Reeza.&amp;nbsp; Good advice.&amp;nbsp; I'll try to rewrite one and if it is too labour intensive, I'll just move on.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Apr 2019 19:41:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ods-options-for-tab-color-not-working/m-p/552308#M153518</guid>
      <dc:creator>shellp55</dc:creator>
      <dc:date>2019-04-18T19:41:46Z</dc:date>
    </item>
    <item>
      <title>Re: ods options for tab_color not working</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ods-options-for-tab-color-not-working/m-p/552311#M153521</link>
      <description>&lt;P&gt;FYI - for the new tagset you linked to you, you need to use ODS TAGSETS.EXCELXP&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;_mod&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;Your code as shown doesn't do that, what happens if you fix that? It references the parent tagsets so should still maintain all features.&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;I tried all the options above but couldn't figure it out &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;I also looked at the XML file and it appears to be using #FFFFF format but at the same time couldn't find the blue (0000FF) specified :(.&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;My next debugging step would be to create two files, one with colours, one without and do a file comparison to see how it's being set and work backwards from there. Unfortunately I don't have the time to do that now.&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Apr 2019 19:46:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ods-options-for-tab-color-not-working/m-p/552311#M153521</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-04-18T19:46:54Z</dc:date>
    </item>
  </channel>
</rss>

