Hi Team,
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[0];
worksheet.OleObjects.Add(14, 3, 40, 80, binaryImg);
worksheet.OleObjects[0].ObjectData = objectData;
worksheet.OleObjects[0].Text = "test";
worksheet.OleObjects[0].DisplayAsIcon = true;
worksheet.OleObjects[0].HeightInch = 0.64;
worksheet.OleObjects[0].WidthInch = 0.78;
worksheet.OleObjects[0].ObjectSourceFullName = (excelPath);
worksheet.OleObjects[0].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?
Thanks,
Mahith Mohan