<?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 Excel file in use in Product Forum</title>
    <link>https://community.blueprism.com/t5/Product-Forum/Excel-file-in-use/m-p/72107#M24712</link>
    <description>Hi,&amp;nbsp;

&amp;nbsp;

I was wondering if it is possible to ascertain if an excel is being used by another process. For example, if one process and one resource are using the file, then a different process and resource would presumably throw an error when trying to access the same file.&amp;nbsp;

&amp;nbsp;

Is there any functionality within BP to allow the process to check to see if the file is currently open or being used?

&amp;nbsp;

Many thanks,&amp;nbsp;

&amp;nbsp;

B</description>
    <pubDate>Fri, 01 Mar 2019 13:42:00 GMT</pubDate>
    <dc:creator>BenAnderson</dc:creator>
    <dc:date>2019-03-01T13:42:00Z</dc:date>
    <item>
      <title>Excel file in use</title>
      <link>https://community.blueprism.com/t5/Product-Forum/Excel-file-in-use/m-p/72107#M24712</link>
      <description>Hi,&amp;nbsp;

&amp;nbsp;

I was wondering if it is possible to ascertain if an excel is being used by another process. For example, if one process and one resource are using the file, then a different process and resource would presumably throw an error when trying to access the same file.&amp;nbsp;

&amp;nbsp;

Is there any functionality within BP to allow the process to check to see if the file is currently open or being used?

&amp;nbsp;

Many thanks,&amp;nbsp;

&amp;nbsp;

B</description>
      <pubDate>Fri, 01 Mar 2019 13:42:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/Excel-file-in-use/m-p/72107#M24712</guid>
      <dc:creator>BenAnderson</dc:creator>
      <dc:date>2019-03-01T13:42:00Z</dc:date>
    </item>
    <item>
      <title>One way is to use Blue Prism…</title>
      <link>https://community.blueprism.com/t5/Product-Forum/Excel-file-in-use/m-p/72108#M24713</link>
      <description>One way is to&amp;nbsp;use Blue Prism's&amp;nbsp;Environment Locks to control access to shared resources like a file in your case.</description>
      <pubDate>Fri, 01 Mar 2019 14:55:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/Excel-file-in-use/m-p/72108#M24713</guid>
      <dc:creator>Deep.Shah</dc:creator>
      <dc:date>2019-03-01T14:55:00Z</dc:date>
    </item>
    <item>
      <title>Hi Deep.Shah, 
 
Thanks for…</title>
      <link>https://community.blueprism.com/t5/Product-Forum/Excel-file-in-use/m-p/72109#M24714</link>
      <description>Hi Deep.Shah,&amp;nbsp;
&amp;nbsp;
Thanks for your reply. If I was to use a lock, would that be visible across all processes. or are locks process specific? So for example, if two different processes are trying to access the same excel file, one process can access it because it has the lock, but the other process can't?&amp;nbsp;
&amp;nbsp;
Many thanks in advance,
&amp;nbsp;
B</description>
      <pubDate>Fri, 01 Mar 2019 16:13:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/Excel-file-in-use/m-p/72109#M24714</guid>
      <dc:creator>BenAnderson</dc:creator>
      <dc:date>2019-03-01T16:13:00Z</dc:date>
    </item>
    <item>
      <title>To answer your question, yes…</title>
      <link>https://community.blueprism.com/t5/Product-Forum/Excel-file-in-use/m-p/72110#M24715</link>
      <description>To answer your question, yes, the lock is visible to all processes. Environment Locks are visible across the entire Blue Prism environment so any runtime resource running any process can check for a specific Environment Lock. But I'd caution you that if you haven't used them before, you should go ahead and do some thorough testing to understand that feature. The first thing you will notice is that it does not actually lock anything except an arbitrary piece of text in the Environment Locks section of the System tab in Blue Prism. Only processes that adhere to the 'contract' of acquiring the lock will be beholden to the rule of only one resource accessing the file at a time.
Also, one thing I've done sometimes as a secondary measure to determine if an Excel file is currently in use is to use the 'File Exists' action looking for the file but with the characters ~$ at the beginning. When Excel becomes locked, a lock file is created in the same folder that is prepended with those two characters. If the file exists, then the process would know not to try opening it.</description>
      <pubDate>Fri, 01 Mar 2019 17:27:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/Excel-file-in-use/m-p/72110#M24715</guid>
      <dc:creator>david.l.morris</dc:creator>
      <dc:date>2019-03-01T17:27:00Z</dc:date>
    </item>
    <item>
      <title>Hi David, 
 
Many thanks for…</title>
      <link>https://community.blueprism.com/t5/Product-Forum/Excel-file-in-use/m-p/72111#M24716</link>
      <description>Hi David,&amp;nbsp;
&amp;nbsp;
Many thanks for your response. Your secondary measure is very clever, and is exactly the kind of thing I was looking for. I'll spend some time looking at and testing both options.&amp;nbsp;
&amp;nbsp;
Thank you again,&amp;nbsp;
&amp;nbsp;
Ben</description>
      <pubDate>Fri, 01 Mar 2019 17:35:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/Excel-file-in-use/m-p/72111#M24716</guid>
      <dc:creator>BenAnderson</dc:creator>
      <dc:date>2019-03-01T17:35:00Z</dc:date>
    </item>
  </channel>
</rss>

