ExportSelectionToNewNodeXLWorkbook()
{
AssertValid();
// Get the path to the application's template.
String sTemplatePath;
if (!ApplicationUtil.TryGetTemplatePath(out sTemplatePath))
{
throw new ExportWorkbookException(
ApplicationUtil.GetMissingTemplateMessage());
}
Workbook oNewNodeXLWorkbook = null;
CopyTableToNewNodeXLWorkbook(WorksheetNames.Edges,
TableNames.Edges, sTemplatePath, ref oNewNodeXLWorkbook);
CopyTableToNewNodeXLWorkbook(WorksheetNames.Vertices,
TableNames.Vertices, sTemplatePath, ref oNewNodeXLWorkbook);
if (oNewNodeXLWorkbook == null)
{
throw new ExportWorkbookException(
"There are no selected edges or vertices to export to a new"
+ " workbook."
);
}
return(oNewNodeXLWorkbook);
}