I'm dealing with a problem with libXL
and Office365.
I created an Excel file with Office 365: a simple formula which shows the content of a cell from another sheet. Then I proceeded to write something in that source cell through libXl
. When I open the output file the formula is not calculated until I press CTRL+ALT+SHIFT+F9
.
If I create the xlsx
file from Office 2013 then the formula is correctly updated.
Couldn' find anything on their website whether O365
is supported or not.
Here's the code to reproduce the issue, (I can provide the two input xlsx files if needed):
#include "stdafx.h"
#include "libxl.h"
using namespace libxl;
int main()
{
Book* book = xlCreateXMLBook();
// xlsx file created by Office 2013
if (book->load(L"office2013.xlsx"))
{
Sheet* sheet = book->getSheet(0);
if (sheet)
sheet->writeNum(2, 2, 42);
book->save(L"okay.xlsx"); // works correctly when opened
}
// xlsx file created by O365
if (book->load(L"office365.xlsx"))
{
Sheet* sheet = book->getSheet(0);
if (sheet)
sheet->writeNum(2, 2, 42);
book->save(L"bugged.xlsx"); // must press CTRL+ALT+SHIFT+F9 to see '42' in the second sheet
}
book->release();
return 0;
}
This is the source sheet (number 42 written by the above code):
This is the not working formula (written in Excel):
Thank you