We are trying to open the excel workbook in the try block using open method as follows
wBook = oBooks.Open(lpcszFileSpec, vUpdateLinks, vReadOnly, covOptional, covOptional,
covOptional, covTrue, covOptional, covOptional, covOptional,
covOptional, covOptional, covOptional, covOptional, covOptional);
where lpcszFileSpec is the filename and other variables are defined as below.
COleVariant covOptional((long)DISP_E_PARAMNOTFOUND, VT_ERROR);
COleVariant vUpdateLinks((long)FALSE);
COleVariant vReadOnly((long)FALSE);
vUpdateLinks.ChangeType(VT_BOOL);
vReadOnly.ChangeType(VT_BOOL);
COleVariant covTrue((short)TRUE);
We are getting the exception on the above open call and we log it as "OLE Execption caught: SCODE = %x"), COleException::Process(e)),in our case the "COleException::Process(e)" is printed as 800706be and reason is printed using e->GetErrorMessage ,which is printed as "The remote procedure call failed".
The same is working without any issue in Excel 2016,where this is an intermittent issue in Office 365