Please see the following sample code on how to add rtf file as an Ole Object in Excel file for your requirements for your reference:
Workbook workbook = new Workbook(“e:\test2\Book1.xlsx”);
//Get the first worksheet.
Worksheet sheet = workbook.Worksheets[0];
//Define a string variable to store the image path.
string ImageUrl = @“e:\test\abc.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.
fs.Close();
//Get an rtf file path in a variable.
string path = @“e:\test2\test.rtf”;
//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.
fs.Close();
sheet.OleObjects.Add(0, 0, 40, 40, imageData);
//Set embedded ole object data.
sheet.OleObjects[0].ObjectData = objectData;
sheet.OleObjects[0].FileFormatType = FileFormatType.Unknown;
sheet.OleObjects[0].ObjectSourceFullName = path;
//Save the excel file
workbook.Save(@“e:\test2\out1.xlsx”);
Hope, this helps a bit.
Thank you.