function addCourseToTable() {

		// Run a batch operation against the Excel object model
		Excel.run(function (ctx) {

			// Create a proxy for the tables rows
			var tableRows = ctx.workbook.tables.getItem('CoursesTable').rows;

			// Queue a command to add a new row at the end of the table for the course
			tableRows.add(null, [[$("#course-name option:selected").text(), $("#course-id").val(), $("#credit-type").val(), $("#credits").val(), $("input[type='radio']:checked").val(), $("#semester").val()]]);

			// Run the queued-up commands, and return a promise to indicate task completion
			return ctx.sync();
		})
		.catch(function (error) {
			// Always be sure to catch any accumulated errors that bubble up from the Excel.run execution
			app.showNotification("Error: " + error);
			console.log("Error: " + error);
			if (error instanceof OfficeExtension.Error) {
				console.log("Debug info: " + JSON.stringify(error.debugInfo));
			}
		});
	}
// Adds a course to the Courses table
Adds a course to the Courses table
Adds a course to the Courses table
function addCourseToTable() {
		Excel.run(function (ctx) {
			var tableRows = ctx.workbook.tables.getItem('CoursesTable').rows;
			tableRows.add(null, [[$("#course-name option:selected").text(), $("#course-id").val(), $("#credit-type").val(), $("#credits").val(), $("input[type='radio']:checked").val(), $("#semester").val()]]);
			return ctx.sync();
		})
		.catch(function (error) {
			app.showNotification("Error: " + error);
			console.log("Error: " + error);
			if (error instanceof OfficeExtension.Error) {
				console.log("Debug info: " + JSON.stringify(error.debugInfo));
			}
		});
	}
function addCourseToTable ( ) { Excel . run ( function ( ctx ) { var tableRows = ctx . workbook . tables . getItem ( 'CoursesTable' ) . rows ; tableRows . add ( null , [ [ $ ( "#course-name option:selected" ) . text ( ) , $ ( "#course-id" ) . val ( ) , $ ( "#credit-type" ) . val ( ) , $ ( "#credits" ) . val ( ) , $ ( "input[type='radio']:checked" ) . val ( ) , $ ( "#semester" ) . val ( ) ] ] ) ; return ctx . sync ( ) ; } ) . catch ( function ( error ) { app . showNotification ( "Error: " + error ) ; console . log ( "Error: " + error ) ; if ( error instanceof OfficeExtension . Error ) { console . log ( "Debug info: " + JSON . stringify ( error . debugInfo ) ) ; } } ) ; }
Adds a course to the Courses table
Adds a course to the Courses table
// Run a batch operation against the Excel object model // Create a proxy for the tables rows // Queue a command to add a new row at the end of the table for the course // Run the queued-up commands, and return a promise to indicate task completion // Always be sure to catch any accumulated errors that bubble up from the Excel.run execution