I am using the following simplified code to calculate Excel:
var dataDir = @"c:\temp\";
// Creating a file stream containing the Excel file to be opened
using (var fstream = new FileStream(dataDir + "pivot_test.xlsx", FileMode.Open))
{
// Instantiate a Workbook object that represents the existing Excel file
var workbook = new Workbook(fstream);
workbook.CalculateFormula();
workbook.Save(dataDir + "xxx.xlsx");
}
I have a cell, that uses the data from an external Excel using the following code (the file is stored at sharepoint):
=GETPIVOTDATA(“Sales”,‘https://some_url.com/[Sample - Superstore.xlsx]Sheet1’!B16)
The issue is when I open the Excel on a computer that does NOT have access to the specific sharepoint file - the value becomes #REF. In Excel, it does not happen.
I am attaching the sample and the data Excels.
pivot_test.zip (8.7 KB)
Sample - Superstore.zip (2.3 MB)