Inserting a WAV file as an Ole Object

Contents
[ ]
from aspose.cells import FileFormatType, Workbook
import bytearray
# For complete examples and data files, please go to https:# github.com/aspose-cells/Aspose.Cells-for-.NET
# The path to the documents directory.
dataDir = RunExamples.GetDataDir(".")
# Define a string variable to store the image path.
ImageUrl = dataDir + "image2.jpg"
# Get the picture into the streams.
fs = open(ImageUrl, "rb")
# Define a byte array.
imageData = bytearray(utils.filesize(fs))
# Obtain the picture into the array of bytes from streams.
fs.readinto(imageData)
# Close the stream.
fs.close()
# Get an excel file path in a variable.
path = dataDir + "chord.wav"
# Get the file into the streams.
fs = open(path, "rb")
# Define an array of bytes.
objectData = bytearray(utils.filesize(fs))
# Store the file from streams.
fs.readinto(objectData)
# Close the stream.
fs.close()
intIndex = 0
# Instantiate a new Workbook.
workbook = Workbook()
sheet = workbook.worksheets[0]
# Add Ole Object
sheet.ole_objects.add(14, 3, 200, 220, imageData)
workbook.worksheets[0].ole_objects[intIndex].file_format_type = FileFormatType.UNKNOWN
workbook.worksheets[0].ole_objects[intIndex].object_data = objectData
workbook.worksheets[0].ole_objects[intIndex].object_source_full_name = path
# Save the excel file
workbook.save(dataDir + "testWAV.out.xlsx")