<?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: Bypass Excel Import Wizard in script in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Bypass-Excel-Import-Wizard-in-script/m-p/358226#M60834</link>
    <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/4587"&gt;@danschikore&lt;/a&gt;&amp;nbsp;Is the procedure referenced here still the only way to accomplish this? Is there any thought to removing the need to write in this kludge to get the desired scripting behavior?&lt;/P&gt;</description>
    <pubDate>Thu, 11 Feb 2021 17:15:33 GMT</pubDate>
    <dc:creator>mjoner</dc:creator>
    <dc:date>2021-02-11T17:15:33Z</dc:date>
    <item>
      <title>Bypass Excel Import Wizard in script</title>
      <link>https://community.jmp.com/t5/Discussions/Bypass-Excel-Import-Wizard-in-script/m-p/238503#M47120</link>
      <description>&lt;P&gt;I am trying to open a .xslx file from within an JMP application when the "OK" button of an application window is pressed. My problem is I'm finding it hard to bypass with Excel wizard window and just open directly.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want the file to open in JMP using the Excel options I specify in an Open() statement. To get my Open() statement options correct, I opened the file manually and copied the Open() statement from the table's Source script, so I think all those options are right. It's a multi-worksheet excel file, and I only want one worksheet in JMP, so here's what my Open() state looks like:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Open(
	"~/Desktop/test.xlsx",
	Worksheets( "Data" ),
	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( 1 ),
		Data Starts on Row( 2 ),
		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( 1 ),
		Suppress Empty Columns( 1 ),
		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;Oddly, when I execute this open statement in a free-standing script, everything happens as I want: the file opens directly without the Excel Wizard pane popping up.&lt;/P&gt;&lt;P&gt;However, when I include the identical Open() statement as part of the script of a JMP application that I am building, I can't seem to stop the wizard pane from opening. (The Open() statement is called when I click the "OK" button of my application's user input window.)&lt;/P&gt;&lt;P&gt;Any ideas why this is happening and how to stop it?&lt;/P&gt;</description>
      <pubDate>Fri, 13 Dec 2019 18:35:01 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Bypass-Excel-Import-Wizard-in-script/m-p/238503#M47120</guid>
      <dc:creator>john_madden</dc:creator>
      <dc:date>2019-12-13T18:35:01Z</dc:date>
    </item>
    <item>
      <title>Re: Bypass Excel Import Wizard in script</title>
      <link>https://community.jmp.com/t5/Discussions/Bypass-Excel-Import-Wizard-in-script/m-p/238544#M47128</link>
      <description>&lt;P&gt;I've also experienced this and have found one workaround. Save the &lt;EM&gt;Open()&lt;/EM&gt;&amp;nbsp;command as a separate script and use &lt;EM&gt;Include()&lt;/EM&gt; to run the code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;// Create a jsl file with the Open() command
f = Save Text File(
	"~/Desktop/test.jsl",
	Char(
		Name Expr(
			Open(
				"~/Desktop/test.xlsx",
				Worksheets( "Data" ),
				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( 1 ),
					Data Starts on Row( 2 ),
					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( 1 ),
					Suppress Empty Columns( 1 ),
					Treat as Hierarchy( 0 ),
					Multiple Series Stack( 0 ),
					Import Cell Colors( 0 ),
					Limit Column Detect( 0 ),
					Column Separator String( "-" )
				)
			)
		)
	)
);

// Invoke Open() via user input
nw = New Window( "open test", Button Box( "OK", Include( f ) ) );&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 13 Dec 2019 23:09:16 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Bypass-Excel-Import-Wizard-in-script/m-p/238544#M47128</guid>
      <dc:creator>ms</dc:creator>
      <dc:date>2019-12-13T23:09:16Z</dc:date>
    </item>
    <item>
      <title>Re: Bypass Excel Import Wizard in script</title>
      <link>https://community.jmp.com/t5/Discussions/Bypass-Excel-Import-Wizard-in-script/m-p/238564#M47136</link>
      <description>&lt;P&gt;Thanks, ms. This will be helpful in the future. In the meantime, I've figured out a different workaround for my situation, but this is good to have in the toolbox for the next time.&lt;/P&gt;&lt;P&gt;There's a section in the Scripting Guide (p. 333) that discusses the context-sensitivity of the Open() function and relates it to the Excel Wizard, but I don't find it terribly clear. I can't help thinking that the behavior discussed here is either a shortcoming (?bug)&amp;nbsp;in the implementation of Open(), or else needs more documentation.&lt;/P&gt;&lt;P&gt;For example, one thing that would be great is an explicit option in Open() of whether of not to use the wizard, instead of keying off a preference. Just my two cents.&lt;/P&gt;</description>
      <pubDate>Sat, 14 Dec 2019 16:59:44 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Bypass-Excel-Import-Wizard-in-script/m-p/238564#M47136</guid>
      <dc:creator>john_madden</dc:creator>
      <dc:date>2019-12-14T16:59:44Z</dc:date>
    </item>
    <item>
      <title>Re: Bypass Excel Import Wizard in script</title>
      <link>https://community.jmp.com/t5/Discussions/Bypass-Excel-Import-Wizard-in-script/m-p/238642#M47159</link>
      <description>&lt;P&gt;I've tried to reproduce this problem with JMP 13/14/15 using the attached JMP Application.&amp;nbsp; The button press script is shown below, and it correctly opens the table in all of the versions that I've tried so far.&amp;nbsp; Does this example work for you?&amp;nbsp; How does this differ from the Application that you are developing, and what version of JMP are you using?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Button1Press = Function( {this}, 
	// This function is called when the button is pressed
	Open(
		"$SAMPLE_IMPORT_DATA\VA Lung Cancer.xls",
		Worksheets( "VA Lung Cancer" ),
		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( 1 ),
			Data Starts on Row( 2 ),
			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( 1 ),
			Suppress Empty Columns( 1 ),
			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;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 16 Dec 2019 14:47:00 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Bypass-Excel-Import-Wizard-in-script/m-p/238642#M47159</guid>
      <dc:creator>danschikore</dc:creator>
      <dc:date>2019-12-16T14:47:00Z</dc:date>
    </item>
    <item>
      <title>Re: Bypass Excel Import Wizard in script</title>
      <link>https://community.jmp.com/t5/Discussions/Bypass-Excel-Import-Wizard-in-script/m-p/238658#M47162</link>
      <description>Dan, Thanks for responding. I'll try this out, and I'll send you separately the application that is causing my problem. Give me a bit. John</description>
      <pubDate>Mon, 16 Dec 2019 15:47:41 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Bypass-Excel-Import-Wizard-in-script/m-p/238658#M47162</guid>
      <dc:creator>john_madden</dc:creator>
      <dc:date>2019-12-16T15:47:41Z</dc:date>
    </item>
    <item>
      <title>Re: Bypass Excel Import Wizard in script</title>
      <link>https://community.jmp.com/t5/Discussions/Bypass-Excel-Import-Wizard-in-script/m-p/238830#M47191</link>
      <description>&lt;P&gt;It turns out that behavior is different on Windows and Mac, likely due to differences in the supporting libraries for reading Excel files.&amp;nbsp; On Mac, an Open() script called directly will open the file as expected, but an Open() call invoked from a button click will bring up the Excel Wizard.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The workaround that&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/182"&gt;@ms&lt;/a&gt;&amp;nbsp;provided forces JMP into "batch" mode, which changes the logic to behave as though the script was run directly rather than via a button.&amp;nbsp; Another way to do that which does not require an intermediate file is to embed your script in a ScriptBox and invoke &amp;lt;&amp;lt;Run on the box.&amp;nbsp; Here's an example that should work on both Mac and WIndows from a button-click:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;// One way to force JMP into batch mode is to embed the script in a ScriptBox
// and invoke &amp;lt;&amp;lt;Run on the script box.
New Window( "button scriptbox",
	Button Box( "Open",
		&amp;lt;&amp;lt;Set Function(
			Function( {this},
				{scriptbox},
				scriptbox = Script Box(
					"\[
					Open(
						"$SAMPLE_IMPORT_DATA\Texas Precipitation.xlsx",
						Worksheets( "2009" ),
						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( 1 ),
							Data Starts on Row( 3 ),
							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( 1 ),
							Suppress Empty Columns( 1 ),
							Treat as Hierarchy( 0 ),
							Multiple Series Stack( 0 ),
							Import Cell Colors( 0 ),
							Limit Column Detect( 0 ),
							Column Separator String( "-" )
						)
					)
					]\"
				);
				scriptbox &amp;lt;&amp;lt; Run;
			)
		)
	)
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 17 Dec 2019 19:49:57 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Bypass-Excel-Import-Wizard-in-script/m-p/238830#M47191</guid>
      <dc:creator>danschikore</dc:creator>
      <dc:date>2019-12-17T19:49:57Z</dc:date>
    </item>
    <item>
      <title>Re: Bypass Excel Import Wizard in script</title>
      <link>https://community.jmp.com/t5/Discussions/Bypass-Excel-Import-Wizard-in-script/m-p/239962#M47420</link>
      <description>Dan,&lt;BR /&gt;Thanks for this follow-up. I had eventually tried everything else and ended up using &lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/182"&gt;@ms&lt;/a&gt;'s solution of embedding the open statement inside an Include() file. This explains what's going on, and provides a different workaround.&lt;BR /&gt;John</description>
      <pubDate>Wed, 01 Jan 2020 17:20:29 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Bypass-Excel-Import-Wizard-in-script/m-p/239962#M47420</guid>
      <dc:creator>john_madden</dc:creator>
      <dc:date>2020-01-01T17:20:29Z</dc:date>
    </item>
    <item>
      <title>Re: Bypass Excel Import Wizard in script</title>
      <link>https://community.jmp.com/t5/Discussions/Bypass-Excel-Import-Wizard-in-script/m-p/358226#M60834</link>
      <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/4587"&gt;@danschikore&lt;/a&gt;&amp;nbsp;Is the procedure referenced here still the only way to accomplish this? Is there any thought to removing the need to write in this kludge to get the desired scripting behavior?&lt;/P&gt;</description>
      <pubDate>Thu, 11 Feb 2021 17:15:33 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Bypass-Excel-Import-Wizard-in-script/m-p/358226#M60834</guid>
      <dc:creator>mjoner</dc:creator>
      <dc:date>2021-02-11T17:15:33Z</dc:date>
    </item>
    <item>
      <title>Re: Bypass Excel Import Wizard in script</title>
      <link>https://community.jmp.com/t5/Discussions/Bypass-Excel-Import-Wizard-in-script/m-p/358493#M60858</link>
      <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/6538"&gt;@mjoner&lt;/a&gt; - Yes, this workaround is still required through at least JMP 16.0.&lt;/P&gt;</description>
      <pubDate>Fri, 12 Feb 2021 14:59:49 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Bypass-Excel-Import-Wizard-in-script/m-p/358493#M60858</guid>
      <dc:creator>danschikore</dc:creator>
      <dc:date>2021-02-12T14:59:49Z</dc:date>
    </item>
    <item>
      <title>Re: Bypass Excel Import Wizard in script</title>
      <link>https://community.jmp.com/t5/Discussions/Bypass-Excel-Import-Wizard-in-script/m-p/822132#M100154</link>
      <description>&lt;P&gt;In case anyone is puzzling over this one, here is an alternative approach: 1. get &amp;amp; store the user preference for Excel Open Method; 2. change it to what you need; 3. open the file; 4. change the setting back to what it was&lt;/P&gt;&lt;P&gt;e.g.&lt;/P&gt;&lt;P&gt;originalPref = Get Preferences( Excel Open Method );&lt;BR /&gt;Set Preference(Excel Open Method("Open All Sheets"));&lt;/P&gt;&lt;P&gt;myPath = Pick File(.... etc&lt;/P&gt;&lt;P&gt;dt = Open(myPath...)&lt;/P&gt;&lt;P&gt;eval(originalPref)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Dec 2024 08:37:26 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Bypass-Excel-Import-Wizard-in-script/m-p/822132#M100154</guid>
      <dc:creator>PatB</dc:creator>
      <dc:date>2024-12-12T08:37:26Z</dc:date>
    </item>
    <item>
      <title>Re: Bypass Excel Import Wizard in script</title>
      <link>https://community.jmp.com/t5/Discussions/Bypass-Excel-Import-Wizard-in-script/m-p/825146#M100507</link>
      <description>&lt;P&gt;I'm still having this problem with JMP 17.2 on my Mac, and my code to open the excel sheet has variables that require the user to enter the value.&lt;/P&gt;</description>
      <pubDate>Wed, 25 Dec 2024 02:13:56 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Bypass-Excel-Import-Wizard-in-script/m-p/825146#M100507</guid>
      <dc:creator>lehaofeng</dc:creator>
      <dc:date>2024-12-25T02:13:56Z</dc:date>
    </item>
  </channel>
</rss>

