<?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: Open function with relative file location in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Open-function-with-relative-file-location/m-p/673654#M86112</link>
    <description>&lt;P&gt;Perhaps start off by putting in a couple of diagnostic lines prior to doing the open:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;show( RelativeLocation );
show( FileExists(RelativeLocation) );&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 02 Sep 2023 12:24:07 GMT</pubDate>
    <dc:creator>David_Burnham</dc:creator>
    <dc:date>2023-09-02T12:24:07Z</dc:date>
    <item>
      <title>Open function with relative file location</title>
      <link>https://community.jmp.com/t5/Discussions/Open-function-with-relative-file-location/m-p/673642#M86110</link>
      <description>&lt;P&gt;I need to use the open function with a relative file location. The following code finds the location, and stores the path to the file in the variable&amp;nbsp;&lt;CODE class=" language-jsl"&gt;RelativeLocation&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;relativePath = Get Default Directory();
UPtwo = Left( relativePath, Contains( relativePath, "/Folder/", -2 ) );
RelativeLocation = UPtwo || "Excel_file.xlsx";&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;However, when using the &lt;EM&gt;Open&lt;/EM&gt; function with the&amp;nbsp;&lt;CODE class=" language-jsl"&gt;RelativeLocation&lt;/CODE&gt; variable, the script crashes. Here is an example:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Open(RelativeLocation,
	Worksheets( "Summary" ),
	Use for all sheets( 1 ),
	Concatenate Worksheets( 0 ),
	Create Concatenation Column( 0 ),
	Worksheet Settings(
		1,
		Has Column Headers( 1 ),
		Number of Rows in Headers( 1 ),
		Headers Start on Row( 3 ),
		Data Starts on Row( 4 ),
		Data Starts on Column( 1 ),
		Data Ends on Row( 0 ),
		Data Ends on Column( 0 ),
		Replicated Spanned Rows( 1 ),
		Replicated Spanned Headers( 0 ),
		Suppress Hidden Rows( 1 ),
		Suppress Hidden Columns( 0 ),
		Suppress Empty Columns( 0 ),
		Treat as Hierarchy( 0 ),
		Multiple Series Stack( 0 ),
		Import Cell Colors( 0 ),
		Limit Column Detect( 0 ),
		Column Separator String( "-" )
	)
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;This gives the following error message:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Steffen_Bugge_0-1693640843832.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/56188i0877255F36DC9872/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Steffen_Bugge_0-1693640843832.png" alt="Steffen_Bugge_0-1693640843832.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 02 Sep 2023 07:49:37 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Open-function-with-relative-file-location/m-p/673642#M86110</guid>
      <dc:creator>Steffen_Bugge</dc:creator>
      <dc:date>2023-09-02T07:49:37Z</dc:date>
    </item>
    <item>
      <title>Re: Open function with relative file location</title>
      <link>https://community.jmp.com/t5/Discussions/Open-function-with-relative-file-location/m-p/673654#M86112</link>
      <description>&lt;P&gt;Perhaps start off by putting in a couple of diagnostic lines prior to doing the open:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;show( RelativeLocation );
show( FileExists(RelativeLocation) );&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 02 Sep 2023 12:24:07 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Open-function-with-relative-file-location/m-p/673654#M86112</guid>
      <dc:creator>David_Burnham</dc:creator>
      <dc:date>2023-09-02T12:24:07Z</dc:date>
    </item>
    <item>
      <title>Re: Open function with relative file location</title>
      <link>https://community.jmp.com/t5/Discussions/Open-function-with-relative-file-location/m-p/673705#M86118</link>
      <description>&lt;P&gt;Thanks a lot,&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/4536"&gt;@David_Burnham&lt;/a&gt;&amp;nbsp;!&lt;/P&gt;&lt;PRE class="language-jsl"&gt;&lt;CODE&gt;show( FileExists(RelativeLocation) );&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;gave a negative answer, and&amp;nbsp;&lt;/P&gt;&lt;PRE class="language-jsl"&gt;&lt;CODE&gt;show( RelativeLocation );&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;indicated that the path was incorrect. So, after fixing the fault, everything works as intended!&lt;/P&gt;</description>
      <pubDate>Sat, 02 Sep 2023 21:19:52 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Open-function-with-relative-file-location/m-p/673705#M86118</guid>
      <dc:creator>Steffen_Bugge</dc:creator>
      <dc:date>2023-09-02T21:19:52Z</dc:date>
    </item>
  </channel>
</rss>

