[]
Creates a workbook reference from a file path.
This method splits the specified path into a base directory and workbook name. If the path points to a workbook in the root directory, the returned reference uses an empty string for BaseDirectory.
public static WorkbookReference FromFilePath(string workbookFullPath)
Public Shared Function FromFilePath(workbookFullPath As String) As WorkbookReference
| Type | Name | Description |
|---|---|---|
| string | workbookFullPath | The full path of the workbook. Must not be |
| Type | Description |
|---|---|
| WorkbookReference | A WorkbookReference created from the specified file path. |
string workbookFullPath = Path.Combine("Users", "DefaultApps", "Documents", "Budget.xlsx");
WorkbookReference reference = WorkbookReference.FromFilePath(workbookFullPath);
string baseDirectory = reference.BaseDirectory;
string name = reference.Name;
| Type | Condition |
|---|---|
| ArgumentNullException | if |
| ArgumentException | if the specified path does not contain a directory part or does not contain a file name. |