<?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: Updating an Excel spreadsheet in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Updating-an-Excel-spreadsheet/m-p/888279#M350969</link>
    <description>&lt;P&gt;As already stated DDE is not only limited to Windows but also depreciated since years. On the other hand I'm not aware of any SAS only way that would allow you to update an Excel cell.&lt;/P&gt;
&lt;P&gt;If your Excel sheet is just a simple rectangular table (a "data sheet") then the easiest way is to just fully re-create the sheet, but if your sheet contains some complex formatting and layout then that might not be an option.&lt;/P&gt;
&lt;P&gt;I started to use Python for such tasks (openpyxl) because it provides the functionality for updating Excel sheets. If the code needs to by dynamic then you can generate such Python code also via SAS and then send it to Python for execution.&lt;/P&gt;</description>
    <pubDate>Tue, 08 Aug 2023 02:16:37 GMT</pubDate>
    <dc:creator>Patrick</dc:creator>
    <dc:date>2023-08-08T02:16:37Z</dc:date>
    <item>
      <title>Updating an Excel spreadsheet</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Updating-an-Excel-spreadsheet/m-p/888155#M350913</link>
      <description>&lt;P&gt;I generate a SAS program that updates specific cells in an Excel spreadsheet. I am using the following syntax:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;options noxwait noxsync;&lt;BR /&gt;x '"filename.xlsx"';&lt;BR /&gt;data _null_;&lt;BR /&gt;filename update1 dde 'excel|worksheet1!r107c5';&lt;BR /&gt;file update1;&lt;BR /&gt;put '4938';&lt;BR /&gt;filename update2 dde 'excel|worksheet1!r107c7';&lt;BR /&gt;file update2;&lt;BR /&gt;put '3146';&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The spreadsheet is updated, but the Excel/worksheet1 must be open and highlighted when the SAS program is executed. If it isn't, there is an error that SAS can't find the file - it doesn't exist to SAS.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a method to update the spreadsheet without opening it first? I would like to schedule the job and have the spreadsheet updated automatically.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;JIm A.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Aug 2023 15:47:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Updating-an-Excel-spreadsheet/m-p/888155#M350913</guid>
      <dc:creator>Jima</dc:creator>
      <dc:date>2023-08-07T15:47:50Z</dc:date>
    </item>
    <item>
      <title>Re: Updating an Excel spreadsheet</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Updating-an-Excel-spreadsheet/m-p/888218#M350943</link>
      <description>&lt;P&gt;Have you tried calling Excel like this?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;x 'excel.exe "c:\MyFolder\filename.xlsx"';&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I can only assume you are using SAS on a PC as DDE simply wont work otherwise. Also please note Microsoft has deprecated DDE so you are lucky it is working for you at all.&lt;/P&gt;</description>
      <pubDate>Mon, 07 Aug 2023 19:56:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Updating-an-Excel-spreadsheet/m-p/888218#M350943</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2023-08-07T19:56:14Z</dc:date>
    </item>
    <item>
      <title>Re: Updating an Excel spreadsheet</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Updating-an-Excel-spreadsheet/m-p/888240#M350952</link>
      <description>&lt;P&gt;You are correct - I am using SAS (9.4 ts1M6) on a PC. Your suggestion doesn't seem to work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there another approach insted of the 'x' and 'dde'?&lt;/P&gt;</description>
      <pubDate>Mon, 07 Aug 2023 22:02:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Updating-an-Excel-spreadsheet/m-p/888240#M350952</guid>
      <dc:creator>Jima</dc:creator>
      <dc:date>2023-08-07T22:02:56Z</dc:date>
    </item>
    <item>
      <title>Re: Updating an Excel spreadsheet</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Updating-an-Excel-spreadsheet/m-p/888266#M350968</link>
      <description>&lt;P&gt;Test this on a Windows command line:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;excel.exe "c:\MyFolder\filename.xlsx"&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If it doesn't work from a command line it won't work in SAS. Also check the properties of your Windows shortcut to Excel and change your command test to be the same.&amp;nbsp; I had to use this to get it working:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;"C:\Program Files (x86)\Microsoft Office\root\Office16\EXCEL.EXE"&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Your software location could be different.&lt;/P&gt;</description>
      <pubDate>Tue, 08 Aug 2023 00:45:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Updating-an-Excel-spreadsheet/m-p/888266#M350968</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2023-08-08T00:45:29Z</dc:date>
    </item>
    <item>
      <title>Re: Updating an Excel spreadsheet</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Updating-an-Excel-spreadsheet/m-p/888279#M350969</link>
      <description>&lt;P&gt;As already stated DDE is not only limited to Windows but also depreciated since years. On the other hand I'm not aware of any SAS only way that would allow you to update an Excel cell.&lt;/P&gt;
&lt;P&gt;If your Excel sheet is just a simple rectangular table (a "data sheet") then the easiest way is to just fully re-create the sheet, but if your sheet contains some complex formatting and layout then that might not be an option.&lt;/P&gt;
&lt;P&gt;I started to use Python for such tasks (openpyxl) because it provides the functionality for updating Excel sheets. If the code needs to by dynamic then you can generate such Python code also via SAS and then send it to Python for execution.&lt;/P&gt;</description>
      <pubDate>Tue, 08 Aug 2023 02:16:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Updating-an-Excel-spreadsheet/m-p/888279#M350969</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2023-08-08T02:16:37Z</dc:date>
    </item>
    <item>
      <title>Re: Updating an Excel spreadsheet</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Updating-an-Excel-spreadsheet/m-p/888316#M350981</link>
      <description>DDE skill is obsolete, Try LIBNAME.&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://communities.sas.com/t5/SAS-Programming/SAS-code-to-update-specific-cell-values-in-Excel/m-p/885125" target="_blank"&gt;https://communities.sas.com/t5/SAS-Programming/SAS-code-to-update-specific-cell-values-in-Excel/m-p/885125&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://communities.sas.com/t5/SAS-Procedures/exporting-updating-an-excel-file/m-p/331607" target="_blank"&gt;https://communities.sas.com/t5/SAS-Procedures/exporting-updating-an-excel-file/m-p/331607&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://communities.sas.com/t5/SAS-Programming/Update-Excel-after-I-run-SAS-Script/m-p/737731" target="_blank"&gt;https://communities.sas.com/t5/SAS-Programming/Update-Excel-after-I-run-SAS-Script/m-p/737731&lt;/A&gt;</description>
      <pubDate>Tue, 08 Aug 2023 11:34:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Updating-an-Excel-spreadsheet/m-p/888316#M350981</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2023-08-08T11:34:16Z</dc:date>
    </item>
    <item>
      <title>Re: Updating an Excel spreadsheet</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Updating-an-Excel-spreadsheet/m-p/970867#M377195</link>
      <description>&lt;P&gt;I had fewer issues updating Excel files once I switched to using the XLSX engine instead of trying to open and overwrite the spreadsheet directly. Also, make sure Excel isn't running in the background. If you're using the latest tools, the &lt;A href="https://ecokeys.co.uk/microsoft-office-2024-download-license-key-for-windows-10-11/" target="_self"&gt;microsoft office 2024 download&lt;/A&gt; now includes better support for integrating with external applications like SAS, which might make things work smoother.&lt;/P&gt;</description>
      <pubDate>Wed, 16 Jul 2025 12:50:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Updating-an-Excel-spreadsheet/m-p/970867#M377195</guid>
      <dc:creator>Dawinchyle</dc:creator>
      <dc:date>2025-07-16T12:50:51Z</dc:date>
    </item>
  </channel>
</rss>

