We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Does anybody know if aspose.cell can handle Word objects linked

I'm investigating the use of Aspose. My question is:

Can aspose.cell can handle Word objects linked & embedded into an Excel file? Also, would you have to use a combination of aspose.cells and aspose.words in order to do this?

Thanks, Dirk

This message was posted using Aspose.Live 2 Forum


Yes, Aspose.Cells can embed a word document as an ole object, you may use the relevant api.

See the document for your reference:

Sample code:

//Instantiate a new Workbook.

Workbook workbook = new Workbook();

//Get the first worksheet.

Worksheet sheet = workbook.Worksheets[0];

//Define a string variable to store the image path.

string ImageUrl = @“e:\test\doc.jpg”;

//Get the picture into the streams.

FileStream fs = File.OpenRead(ImageUrl);

//Define a byte array.

byte[] imageData = new Byte[fs.Length];

//Obtain the picture into the array of bytes from streams.

fs.Read(imageData, 0, imageData.Length);

//Close the stream.


//Get an doc file path in a variable.

string path = @“e:\test\MyDocFile.doc”;

//Get the file into the streams.

fs = File.OpenRead(path);

//Define an array of bytes.

byte[] objectData = new Byte[fs.Length];

//Store the file from streams.

fs.Read(objectData, 0, objectData.Length);

//Close the stream.


sheet.OleObjects.Add(14, 3, 200, 220, imageData);

//Set embedded ole object data.

sheet.OleObjects[0].ObjectData = objectData;

sheet.OleObjects[0].FileType = OleFileType.Doc;

//Save the excel file


Thank you.