[]
        
(Showing Draft Content)

GrapeCity.Documents.Excel.Expressions.WorkbookReference.FromUri

FromUri Method

FromUri(string)

Creates a workbook reference from an absolute URI to a workbook.

This method creates a reference whose base URI is the URI path up to, but not including, the workbook file name. File URIs are not supported. The specified URI must be absolute, must contain a host, and must contain a workbook file name.

Declaration
public static WorkbookReference FromUri(string uri)
Public Shared Function FromUri(uri As String) As WorkbookReference
Parameters
Type Name Description
string uri

The absolute URI of the workbook. Must not be null, must not be a file URI, and must include both a host and a file name.

Returns
Type Description
WorkbookReference

A WorkbookReference created from the specified URI.

Examples
WorkbookReference reference = WorkbookReference.FromUri("https://somesite.com/files/sample.xlsx");
string baseUri = reference.BaseUri;
string name = reference.Name;
Exceptions
Type Condition
ArgumentException

if uri is not a valid absolute URI, if it is a file URI, or if it does not contain a host or workbook file name.