We are facing an issue while embedding a password protected excel in another excel using aspose.cell. Below is the sample of code we are using. We are able to see the worksheet icon embedded in the excel. But when we click the icon, we are getting the error message as “Cannot start the source application for the object”
FileStream fWrite = File.OpenRead(excelPath); byte objectData = new byte[fWrite.Length]; fWrite.Read(objectData, 0, objectData.Length); fWrite.Close(); byte binaryImg = File.ReadAllBytes(imgFile); Workbook workbook = new Workbook(); Worksheet worksheet = workbook.Worksheets; worksheet.OleObjects.Add(14, 3, 40, 80, binaryImg); worksheet.OleObjects.ObjectData = objectData; worksheet.OleObjects.Text = "test"; worksheet.OleObjects.DisplayAsIcon = true; worksheet.OleObjects.HeightInch = 0.64; worksheet.OleObjects.WidthInch = 0.78; worksheet.OleObjects.ObjectSourceFullName = (excelPath); worksheet.OleObjects.FileFormatType = FileFormatType.Unknown; workbook.Save(outPutPath, Aspose.Cells.SaveFormat.Xlsx);
We tried making the FileFormatType as Xlsx. During that time we are getting the error message as “Excel found unreadable content”.
Can you please provide a solution for this approach?