<?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: Excel named ranges intermittently not saving in Microsoft Integration with SAS</title>
    <link>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/Excel-named-ranges-intermittently-not-saving/m-p/348866#M2031</link>
    <description>&lt;P&gt;When I see something like:&lt;/P&gt;
&lt;PRE&gt;*** Date Macros ***;&lt;/PRE&gt;
&lt;P&gt;That makes me think that there were one or more unspecified macro run to create the data set. Was that the case?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Perhaps the issue is with the raw_dates set not getting replaced from a previous run, or not getting created in time to write out.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you just rerun the program without the Open and associated Excel manual steps does the program work?&lt;/P&gt;</description>
    <pubDate>Mon, 10 Apr 2017 20:10:10 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2017-04-10T20:10:10Z</dc:date>
    <item>
      <title>Excel named ranges intermittently not saving</title>
      <link>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/Excel-named-ranges-intermittently-not-saving/m-p/348725#M2030</link>
      <description>&lt;P style="margin: 0in; margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.5pt; font-family: 'Helvetica',sans-serif; color: #333333;"&gt;I have an intermittent issue that is baffling me.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="margin: 0in; margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.5pt; font-family: 'Helvetica',sans-serif; color: #333333;"&gt;SAS EG Version 7.13 (7.100.3.5408) (64-bit)&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="margin: 0in; margin-bottom: .0001pt; font-variant-ligatures: normal; font-variant-caps: normal; orphans: 2; text-align: start; widows: 2; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial; word-spacing: 0px;"&gt;&lt;SPAN style="font-size: 10.5pt; font-family: 'Helvetica',sans-serif; color: #333333;"&gt;Excel 2013&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="margin: 0in; margin-bottom: .0001pt; font-variant-ligatures: normal; font-variant-caps: normal; orphans: 2; text-align: start; widows: 2; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial; word-spacing: 0px;"&gt;&lt;SPAN style="font-size: 10.5pt; font-family: 'Helvetica',sans-serif; color: #333333;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI style="margin: 0in; margin-bottom: .0001pt; font-variant-ligatures: normal; font-variant-caps: normal; orphans: 2; text-align: start; widows: 2; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial; word-spacing: 0px;"&gt;&lt;SPAN style="font-size: 10.5pt; font-family: 'Helvetica',sans-serif; color: #333333;"&gt;We use a LIBNAME statement to access an existing Excel workbook that is in a production area so team members cannot access it (i.e. no&amp;nbsp;person&lt;SPAN class="apple-converted-space"&gt;&amp;nbsp;&lt;/SPAN&gt;has the file open during run time). &amp;nbsp;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI style="margin: 0in; margin-bottom: .0001pt; font-variant-ligatures: normal; font-variant-caps: normal; orphans: 2; text-align: start; widows: 2; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial; word-spacing: 0px;"&gt;&lt;SPAN style="font-size: 10.5pt; font-family: 'Helvetica',sans-serif; color: #333333;"&gt;We run PROC DATASETS to delete the desired excel named ranges.&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI style="margin: 0in; margin-bottom: .0001pt; font-variant-ligatures: normal; font-variant-caps: normal; orphans: 2; text-align: start; widows: 2; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial; word-spacing: 0px;"&gt;&lt;SPAN style="font-size: 10.5pt; font-family: 'Helvetica',sans-serif; color: #333333;"&gt;We then use DATA steps to write to those named ranges.&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI style="margin: 0in; margin-bottom: .0001pt; font-variant-ligatures: normal; font-variant-caps: normal; orphans: 2; text-align: start; widows: 2; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial; word-spacing: 0px;"&gt;&lt;SPAN style="font-size: 10.5pt; font-family: 'Helvetica',sans-serif; color: #333333;"&gt;Finally we clear the libname.&lt;/SPAN&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P style="margin: 0in; margin-bottom: .0001pt; font-variant-ligatures: normal; font-variant-caps: normal; orphans: 2; text-align: start; widows: 2; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial; word-spacing: 0px;"&gt;&lt;SPAN style="font-size: 10.5pt; font-family: 'Helvetica',sans-serif; color: #333333;"&gt;98% of the time everything works just great. &amp;nbsp;But occasionally the program will finish with no issues/warnings/errors noted in the log (actually, the log tells me that the records were written to the named range) but the named ranges have not been updated and the "Date modified" of the Excel file in windows explorer is also from the prior week. &amp;nbsp;Whenever this happens we simply open the workbook, go to a blank cell outside of a named range, enter something, delete what we just entered, resave and close the workbook. &amp;nbsp;Then rerunning the SAS code will update the named ranges.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="margin: 0in; margin-bottom: .0001pt; font-variant-ligatures: normal; font-variant-caps: normal; orphans: 2; text-align: start; widows: 2; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial; word-spacing: 0px;"&gt;&lt;SPAN style="font-size: 10.5pt; font-family: 'Helvetica',sans-serif; color: #333333;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="margin: 0in; margin-bottom: .0001pt; font-variant-ligatures: normal; font-variant-caps: normal; orphans: 2; text-align: start; widows: 2; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial; word-spacing: 0px;"&gt;&lt;SPAN style="font-size: 10.5pt; font-family: 'Helvetica',sans-serif; color: #333333;"&gt;This seems like this is likely more a windows/excel issue more than SAS but the output is going to a client via an automated job so every few months they receive the prior&amp;nbsp;week's report. &amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="margin: 0in; margin-bottom: .0001pt; font-variant-ligatures: normal; font-variant-caps: normal; orphans: 2; text-align: start; widows: 2; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial; word-spacing: 0px;"&gt;&lt;SPAN style="font-size: 10.5pt; font-family: 'Helvetica',sans-serif; color: #333333;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="margin: 0in; margin-bottom: .0001pt; font-variant-ligatures: normal; font-variant-caps: normal; orphans: 2; text-align: start; widows: 2; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial; word-spacing: 0px;"&gt;&lt;SPAN style="font-size: 10.5pt; font-family: 'Helvetica',sans-serif; color: #333333;"&gt;Wondering if anyone else has come across this and what they discovered was the actual root cause. &amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="margin: 0in; margin-bottom: .0001pt; font-variant-ligatures: normal; font-variant-caps: normal; orphans: 2; text-align: start; widows: 2; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial; word-spacing: 0px;"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="margin: 0in; margin-bottom: .0001pt; font-variant-ligatures: normal; font-variant-caps: normal; orphans: 2; text-align: start; widows: 2; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial; word-spacing: 0px;"&gt;&lt;SPAN style="font-size: 10.5pt; font-family: 'Helvetica',sans-serif; color: #333333;"&gt;Thanks&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="margin: 0in; margin-bottom: .0001pt; font-variant-ligatures: normal; font-variant-caps: normal; orphans: 2; text-align: start; widows: 2; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial; word-spacing: 0px;"&gt;&lt;SPAN style="font-size: 10.5pt; font-family: 'Helvetica',sans-serif; color: #333333;"&gt;David&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="margin: 0in; margin-bottom: .0001pt; font-variant-ligatures: normal; font-variant-caps: normal; orphans: 2; text-align: start; widows: 2; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial; word-spacing: 0px;"&gt;&lt;SPAN style="font-size: 10.5pt; font-family: 'Helvetica',sans-serif; color: #333333;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="margin: 0in; margin-bottom: .0001pt; font-variant-ligatures: normal; font-variant-caps: normal; orphans: 2; text-align: start; widows: 2; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial; word-spacing: 0px;"&gt;&lt;SPAN style="font-size: 10.5pt; font-family: 'Helvetica',sans-serif; color: #333333;"&gt;Abbreviated log file below:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;LIBNAME finance EXCEL "S:\Prod_Reporting\SAS_Projects\output\&amp;amp;OUTFILE..xlsx";&lt;BR /&gt;&lt;EM&gt;NOTE: Libref FINANCE was successfully assigned as follows:&amp;nbsp;&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt; Engine: EXCEL &lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; Physical Name: S:\Prod_Reporting\SAS_Projects\output\finance_reports_MTD.xlsx&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;*** clear named ranges; run;&lt;BR /&gt;PROC DATASETS LIB=finance;&lt;BR /&gt;DELETE&lt;BR /&gt;raw_dates;&lt;BR /&gt;QUIT;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;NOTE: Deleting FINANCE.raw_dates (memtype=DATA).&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;*** write data to named ranges; run;&lt;BR /&gt;*** Date Macros ***;&lt;BR /&gt;DATA finance.raw_dates (rename=(period="Report Period"n value ="Date Value"n));&lt;BR /&gt;SET raw_dates;&lt;BR /&gt;RUN;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;NOTE: SAS variable labels, formats, and lengths are not written to DBMS tables.&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;NOTE: There were 15 observations read from the data set WORKSAVE.RAW_DATES.&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;NOTE: The data set FINANCE.raw_dates has 15 observations and 2 variables.&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;LIBNAME finance CLEAR;&lt;BR /&gt;&lt;EM&gt;NOTE: Libref FINANCE has been deassigned.&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Apr 2017 14:45:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/Excel-named-ranges-intermittently-not-saving/m-p/348725#M2030</guid>
      <dc:creator>epp_dog</dc:creator>
      <dc:date>2017-04-10T14:45:52Z</dc:date>
    </item>
    <item>
      <title>Re: Excel named ranges intermittently not saving</title>
      <link>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/Excel-named-ranges-intermittently-not-saving/m-p/348866#M2031</link>
      <description>&lt;P&gt;When I see something like:&lt;/P&gt;
&lt;PRE&gt;*** Date Macros ***;&lt;/PRE&gt;
&lt;P&gt;That makes me think that there were one or more unspecified macro run to create the data set. Was that the case?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Perhaps the issue is with the raw_dates set not getting replaced from a previous run, or not getting created in time to write out.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you just rerun the program without the Open and associated Excel manual steps does the program work?&lt;/P&gt;</description>
      <pubDate>Mon, 10 Apr 2017 20:10:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/Excel-named-ranges-intermittently-not-saving/m-p/348866#M2031</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-04-10T20:10:10Z</dc:date>
    </item>
    <item>
      <title>Re: Excel named ranges intermittently not saving</title>
      <link>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/Excel-named-ranges-intermittently-not-saving/m-p/348880#M2032</link>
      <description>&lt;P&gt;There are actually about 20 named output ranges and I didn't want to bore everyone with all of them but NONE of them got written yesterday night. &amp;nbsp;That one is just where I am writing out a dataset (raw_dates) of all the date macros I used during the running of the program. &amp;nbsp;(So I have a datastep earlier where I write rows to store off each value). &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When this happens, if I do not&amp;nbsp;open the spreadsheet and do the "add something/delete/save" and instead just rerun the wrote to Excel portion, it does not update the data.&lt;/P&gt;</description>
      <pubDate>Mon, 10 Apr 2017 20:33:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/Excel-named-ranges-intermittently-not-saving/m-p/348880#M2032</guid>
      <dc:creator>epp_dog</dc:creator>
      <dc:date>2017-04-10T20:33:21Z</dc:date>
    </item>
    <item>
      <title>Re: Excel named ranges intermittently not saving</title>
      <link>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/Excel-named-ranges-intermittently-not-saving/m-p/349074#M2033</link>
      <description>&lt;P&gt;The SAS log is pretty clear. The Excel Sheet has been deleted and has been re-created and it also tells you how many row have been written to it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And you tell us that you end up not only with the change not applied but even with the Excel workbook not showing the correct modification date!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It's only a theory but that sounds to me very much like&amp;nbsp;some recovery process doing the wrong thing. I'd contact your server admins and ask them if it's possible to get some event log for this Excel workbook.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Besides of getting to the "why" I would assume you want the problem solved asap and have a stable process. I believe it could become a painfull undertaking to get to the bottom of what's going on here&amp;nbsp;so if I were you I'd go for an interim solution where I change my process like:&lt;/P&gt;
&lt;P&gt;create a copy of the Excel workbook and apply the changes there, then replace your original with the copy. That's a bit Voodoo I know. It's just trying to do something different in the hope that this will circumvent not yet discovered&amp;nbsp;interfering processes.&lt;/P&gt;
&lt;P&gt;You could also add a validation step before you send out the Excel, i.e. check a date column which you know must be close to the current date if it's the Excel is in the right version. ....or eventually create always a new Excel workbook with a date in the name.&lt;/P&gt;</description>
      <pubDate>Tue, 11 Apr 2017 12:34:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/Excel-named-ranges-intermittently-not-saving/m-p/349074#M2033</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2017-04-11T12:34:29Z</dc:date>
    </item>
    <item>
      <title>Re: Excel named ranges intermittently not saving</title>
      <link>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/Excel-named-ranges-intermittently-not-saving/m-p/349077#M2034</link>
      <description>&lt;P&gt;Thanks Patrick,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You are right, data isn''t updated and the file "save timestamp" isn't updated either. &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I agree, your suggestion is a bit of voodoo but it might just work (and in my 20 years of SAS coding I certainly have come to accept some strange solutions) .&amp;nbsp;I have always assumed it to be more of a windows/excel issue than SAS.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'll play around with your suggestion of double checking the values in the spreadsheet as that would eliminate the embarassement of sending the client last week's report!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;David&lt;/P&gt;</description>
      <pubDate>Tue, 11 Apr 2017 12:48:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/Excel-named-ranges-intermittently-not-saving/m-p/349077#M2034</guid>
      <dc:creator>epp_dog</dc:creator>
      <dc:date>2017-04-11T12:48:16Z</dc:date>
    </item>
    <item>
      <title>Re: Excel named ranges intermittently not saving</title>
      <link>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/Excel-named-ranges-intermittently-not-saving/m-p/349100#M2035</link>
      <description>&lt;P&gt;&lt;EM&gt;I'll play around with your suggestion of double checking the values in the spreadsheet &lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;And to add some more Voodoo: I would clear and re-assign the libname before this validation step to have more certainty that you're reading the actual Excel and not some cached version.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Apr 2017 13:15:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/Excel-named-ranges-intermittently-not-saving/m-p/349100#M2035</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2017-04-11T13:15:08Z</dc:date>
    </item>
  </channel>
</rss>

