<?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: How do I create a JMP script to import multiple Excel workbooks from SharePoint? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-do-I-create-a-JMP-script-to-import-multiple-Excel-workbooks/m-p/356485#M60641</link>
    <description>&lt;P&gt;It looks like you are assigning all tables to the same variable, dt.&amp;nbsp; That variable can only hold a reference to a single table at a time.&amp;nbsp; Instead, you could make dt a list, and then let it store references to all of the data tables.&amp;nbsp; Here is what that might look like (not tested).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;//SharePoint path, copy link from SharePoint then delete everything after "?"
path = {"https://&amp;lt;&amp;lt;your site&amp;gt;&amp;gt;/Big%20Class.xlsx?", "https://&amp;lt;&amp;lt;your site&amp;gt;&amp;gt;/Big%20Class_2000.xlsx?"};
//SharePoint file, copy link from SharePoint then delete everything after "?" and add "download=1"
file = {"https://&amp;lt;&amp;lt;your site&amp;gt;&amp;gt;/Big%20Class.xlsx?download=1",
"https://&amp;lt;&amp;lt;your site&amp;gt;&amp;gt;/Big%20Class_2000.xlsx?download=1"};

Batch Interactive( 1 );

//Make an empty list to store references to all data tables
dt = list(); 

For( i = 1, i &amp;lt;= N Items( path ), i++, //loop for paths to excel workbooks
	Web( path[i], JMP window );
	For( i = 1, i &amp;lt;= N Items( file ), i++, //loop for excel files
		dt[i] = Open(
			file[i],
			Worksheets( "Big Class" ),
			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( "-" ),

			),
			"Invisible",

		);
		Window( "Web Browser" ) &amp;lt;&amp;lt; close window; //closes the JMP web window
	);
	name = {"Big Class", "Big Class 2000"}; //change table names THIS IS NOT WORKING
	For( i = 1, i &amp;lt;= N Items( name ), i++,
		dt[i] &amp;lt;&amp;lt; Set Name( name[i] )
	);
	Batch Interactive( 0 );
);
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 05 Feb 2021 16:55:46 GMT</pubDate>
    <dc:creator>ih</dc:creator>
    <dc:date>2021-02-05T16:55:46Z</dc:date>
    <item>
      <title>How do I create a JMP script to import multiple Excel workbooks from SharePoint?</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-create-a-JMP-script-to-import-multiple-Excel-workbooks/m-p/356471#M60638</link>
      <description>&lt;P&gt;Hi Everyone,&lt;/P&gt;
&lt;P&gt;I have several Excel o365 workbooks stored in SharePoint that I need to load to JMP and rename each table based on the filename of the excel workbook.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I found code snippets from the JMP Community to help me, thank you everyone!!&lt;/P&gt;
&lt;P&gt;The script:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;hard codes the file names and SharePoint paths&lt;/LI&gt;
&lt;LI&gt;opens the SharePoint site&lt;/LI&gt;
&lt;LI&gt;locates the excel file&lt;/LI&gt;
&lt;LI&gt;opens/imports the Excel file&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;However there are 2 issues.&amp;nbsp; The JMP table names do not rename and there are modal pop up windows that show up that I would like to have closed using script.&lt;/P&gt;
&lt;P&gt;I am attaching Big Class data formatted as an Excel Workbook that you can upload to SharePoint.&amp;nbsp; The script is also attached.&amp;nbsp; Make sure you change the hard coded paths and files names to your SharePoint site.&lt;/P&gt;
&lt;P&gt;Thank you!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;U&gt;Script:&lt;/U&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;//SharePoint path, copy link from SharePoint then delete everything after "?"
path = {"https://&amp;lt;&amp;lt;your site&amp;gt;&amp;gt;/Big%20Class.xlsx?", "https://&amp;lt;&amp;lt;your site&amp;gt;&amp;gt;/Big%20Class_2000.xlsx?"};
//SharePoint file, copy link from SharePoint then delete everything after "?" and add "download=1"
file = {"https://&amp;lt;&amp;lt;your site&amp;gt;&amp;gt;/Big%20Class.xlsx?download=1",
"https://&amp;lt;&amp;lt;your site&amp;gt;&amp;gt;/Big%20Class_2000.xlsx?download=1"};

Batch Interactive( 1 );
For( i = 1, i &amp;lt;= N Items( path ), i++, //loop for paths to excel workbooks
    Web( path[i], JMP window );
    For( i = 1, i &amp;lt;= N Items( file ), i++, //loop for excel files
        dt = Open(
            file[i],
            Worksheets( "Big Class" ),
            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( "-" ),

            ),
            "Invisible",

        );
        Window( "Web Browser" ) &amp;lt;&amp;lt; close window; //closes the JMP web window
    );
    name = {"Big Class", "Big Class 2000"}; //change table names THIS IS NOT WORKING
    For( i = 1, i &amp;lt;= N Items( name ), i++,
        dt &amp;lt;&amp;lt; Set Name( name[i] )
    );
    Batch Interactive( 0 );
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2023 22:05:19 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-create-a-JMP-script-to-import-multiple-Excel-workbooks/m-p/356471#M60638</guid>
      <dc:creator>Onjai</dc:creator>
      <dc:date>2023-06-09T22:05:19Z</dc:date>
    </item>
    <item>
      <title>Re: How do I create a JMP script to import multiple Excel workbooks from SharePoint?</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-create-a-JMP-script-to-import-multiple-Excel-workbooks/m-p/356485#M60641</link>
      <description>&lt;P&gt;It looks like you are assigning all tables to the same variable, dt.&amp;nbsp; That variable can only hold a reference to a single table at a time.&amp;nbsp; Instead, you could make dt a list, and then let it store references to all of the data tables.&amp;nbsp; Here is what that might look like (not tested).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;//SharePoint path, copy link from SharePoint then delete everything after "?"
path = {"https://&amp;lt;&amp;lt;your site&amp;gt;&amp;gt;/Big%20Class.xlsx?", "https://&amp;lt;&amp;lt;your site&amp;gt;&amp;gt;/Big%20Class_2000.xlsx?"};
//SharePoint file, copy link from SharePoint then delete everything after "?" and add "download=1"
file = {"https://&amp;lt;&amp;lt;your site&amp;gt;&amp;gt;/Big%20Class.xlsx?download=1",
"https://&amp;lt;&amp;lt;your site&amp;gt;&amp;gt;/Big%20Class_2000.xlsx?download=1"};

Batch Interactive( 1 );

//Make an empty list to store references to all data tables
dt = list(); 

For( i = 1, i &amp;lt;= N Items( path ), i++, //loop for paths to excel workbooks
	Web( path[i], JMP window );
	For( i = 1, i &amp;lt;= N Items( file ), i++, //loop for excel files
		dt[i] = Open(
			file[i],
			Worksheets( "Big Class" ),
			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( "-" ),

			),
			"Invisible",

		);
		Window( "Web Browser" ) &amp;lt;&amp;lt; close window; //closes the JMP web window
	);
	name = {"Big Class", "Big Class 2000"}; //change table names THIS IS NOT WORKING
	For( i = 1, i &amp;lt;= N Items( name ), i++,
		dt[i] &amp;lt;&amp;lt; Set Name( name[i] )
	);
	Batch Interactive( 0 );
);
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 05 Feb 2021 16:55:46 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-create-a-JMP-script-to-import-multiple-Excel-workbooks/m-p/356485#M60641</guid>
      <dc:creator>ih</dc:creator>
      <dc:date>2021-02-05T16:55:46Z</dc:date>
    </item>
    <item>
      <title>Re: How do I create a JMP script to import multiple Excel workbooks from SharePoint?</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-create-a-JMP-script-to-import-multiple-Excel-workbooks/m-p/357121#M60714</link>
      <description>&lt;P&gt;Adding the dt = list() works.&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Mon, 08 Feb 2021 14:58:53 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-create-a-JMP-script-to-import-multiple-Excel-workbooks/m-p/357121#M60714</guid>
      <dc:creator>Onjai</dc:creator>
      <dc:date>2021-02-08T14:58:53Z</dc:date>
    </item>
  </channel>
</rss>

