<?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: How to Add a Credential to a Specific Cell in Excel Using ODS EXCEL in SAS in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-Add-a-Credential-to-a-Specific-Cell-in-Excel-Using-ODS/m-p/935403#M45012</link>
    <description>Nope.&lt;BR /&gt;If I was right, SAS is unable to set a password on a excel file, you need resort to VBA .&lt;BR /&gt;or maybe @Cynthina_sas knew something I don't know.</description>
    <pubDate>Thu, 11 Jul 2024 00:01:54 GMT</pubDate>
    <dc:creator>Ksharp</dc:creator>
    <dc:date>2024-07-11T00:01:54Z</dc:date>
    <item>
      <title>How to Add a Credential to a Specific Cell in Excel Using ODS EXCEL in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-Add-a-Credential-to-a-Specific-Cell-in-Excel-Using-ODS/m-p/934741#M44947</link>
      <description>&lt;P&gt;Hello everyone,&lt;/P&gt;
&lt;P&gt;I am working on exporting data to an Excel file using the &lt;CODE&gt;ODS EXCEL&lt;/CODE&gt; feature in SAS. Along with the data, I need to add a credential (e.g., a code) to a specific cell, say &lt;CODE&gt;M1&lt;/CODE&gt;.&lt;/P&gt;
&lt;P&gt;Here is a sample code snippet that I am using:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* Sample data */
data sample_data;
    input Name $ Age Gender $ Salary;
    datalines;
    John 30 M 50000
    Jane 25 F 55000
    Sam 28 M 48000
    Lisa 35 F 62000
    ;
run;

/* Export data to Excel using ODS EXCEL */
ods excel file="sample_data.xlsx" options(protect_worksheet='yes');

proc report data=sample_data;
quit;

ods excel options(sheet_interval="none" start_at="M1");

proc odstext;
  p "78YKJXX22";
run;

ods excel close;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I want like&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Daily1_0-1720160821392.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/98161i51135EA8040D2AAF/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Daily1_0-1720160821392.png" alt="Daily1_0-1720160821392.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Jul 2024 06:30:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-Add-a-Credential-to-a-Specific-Cell-in-Excel-Using-ODS/m-p/934741#M44947</guid>
      <dc:creator>Daily1</dc:creator>
      <dc:date>2024-07-05T06:30:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to Add a Credential to a Specific Cell in Excel Using ODS EXCEL in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-Add-a-Credential-to-a-Specific-Cell-in-Excel-Using-ODS/m-p/934750#M44948</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;

&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ksharp_0-1720167722490.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/98164i066637737C6A4E20/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ksharp_0-1720167722490.png" alt="Ksharp_0-1720167722490.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* Sample data */
data sample_data;
infile datalines truncover;
    input Name $ Age Gender $ Salary  (a1-a8 M) ($);
label  M='78YKJXX22'
       a1='*' a2='*' a3='*' a4='*' a5='*' a6='*' a7='*' a8='*';
    datalines;
    John 30 M 50000
    Jane 25 F 55000
    Sam 28 M 48000
    Lisa 35 F 62000
    ;
run;


%let excel= c:\temp\sample_data.xlsx ;




ods _all_ close;
/* Export data to Excel using ODS EXCEL */
ods excel file="&amp;amp;excel." options(protect_worksheet='yes' sheet_name='Sheet1') ;
proc report data=sample_data nowd split='*';
define a1-a8/display style={background=cxFAFBFE foreground=cxFAFBFE bordercolor=cxFAFBFE};
define M/display style={background=cxFAFBFE foreground=black bordercolor=cxFAFBFE};
run;;

ods excel close;

&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Jul 2024 08:44:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-Add-a-Credential-to-a-Specific-Cell-in-Excel-Using-ODS/m-p/934750#M44948</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2024-07-05T08:44:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to Add a Credential to a Specific Cell in Excel Using ODS EXCEL in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-Add-a-Credential-to-a-Specific-Cell-in-Excel-Using-ODS/m-p/935298#M45001</link>
      <description>&lt;P&gt;I am currently working with SAS and I need to generate an Excel file with a specific sheet that is protected by a password. I know how to use ODS to create Excel files, but I’m unsure how to set a password to protect a sheet within the file. Could someone provide an example of how to do this?&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jul 2024 11:35:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-Add-a-Credential-to-a-Specific-Cell-in-Excel-Using-ODS/m-p/935298#M45001</guid>
      <dc:creator>Daily1</dc:creator>
      <dc:date>2024-07-10T11:35:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to Add a Credential to a Specific Cell in Excel Using ODS EXCEL in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-Add-a-Credential-to-a-Specific-Cell-in-Excel-Using-ODS/m-p/935300#M45002</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/236411"&gt;@Daily1&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I am currently working with SAS and I need to generate an Excel file with a specific sheet that is protected by a password. I know how to use ODS to create Excel files, but I’m unsure how to set a password to protect a sheet within the file. Could someone provide an example of how to do this?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Please start a new thread for this.&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jul 2024 11:38:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-Add-a-Credential-to-a-Specific-Cell-in-Excel-Using-ODS/m-p/935300#M45002</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2024-07-10T11:38:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to Add a Credential to a Specific Cell in Excel Using ODS EXCEL in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-Add-a-Credential-to-a-Specific-Cell-in-Excel-Using-ODS/m-p/935403#M45012</link>
      <description>Nope.&lt;BR /&gt;If I was right, SAS is unable to set a password on a excel file, you need resort to VBA .&lt;BR /&gt;or maybe @Cynthina_sas knew something I don't know.</description>
      <pubDate>Thu, 11 Jul 2024 00:01:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-Add-a-Credential-to-a-Specific-Cell-in-Excel-Using-ODS/m-p/935403#M45012</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2024-07-11T00:01:54Z</dc:date>
    </item>
  </channel>
</rss>

