This project has moved and is read-only. For the latest updates, please go here.

This operation is not supported for a relative URI. (Again)

Apr 25, 2012 at 4:04 PM

I know there's already a dead thread about this, but I thought I would create a new one to see if anyone has an answer for this.  I'm trying to open an xlsx file, that has an embedded URI \\servername\foldername\file.xlsx.  So I'm trying to open the file thusly:

 

using (ExcelPackage package = new ExcelPackage(new FileInfo(excelWorkbookFileName)))
{
	ExcelWorksheet worksheet = package.Workbook.Worksheets[1]; // Crashes here

        string v = (string)worksheet.Cells[1,1].Value;

}

On the line marked "Crashes here" I get the following error:  This operation is not supported for a relative URI.

My Workaround is to use ExcelPackage since it seems to be able to open the file correctly.  However, I'm nervous about sticking with this because it hasn't been updated in several years.

Any help will be greatly appreciated!

 

Cheers, Jon

May 2, 2012 at 7:13 PM

Hi,

Yes, it's a bug. I'll add a fix next time i check in.

Jan