I want to embedded image , text file into the excel sheet by using python script.
And after that we can check the content of the file by clicking on the object inside the cell.
With below code I am able to insert image into a particular cell (C2).
But my concern is that how to insert an image as an object or text file also an object into a particular cell of the worksheet.
Please check screen shot for reference.
import openpyxl
import time
import datetime
from openpyxl.drawing.image import Image
################### Todays date ###############################
dateToday=datetime.datetime.today()
FormatedDate=('{:02d}'.format(dateToday.day)+'-'+'{:02d}'.format(dateToday.month)+'-'+'{:04d}'.format(dateToday.year))
print (FormatedDate)
#
Read the Workbook
Sigos_DailyHealthCheckReport = r'D:\Script\Monitoring\CheckReport-6-Dec-2017.xlsx'
Load the Workbook
LoadFile = openpyxl.load_workbook(Sigos_DailyHealthCheckReport)
Access first Worksheet of the Workbook
AccessFile = LoadFile.active
################## SHEET 1To access particular weeksheet with in the workbook.
Sheet2 = LoadFile.get_sheet_by_name('Operational Status Of SITE')
img = Image("D:\Script\Monitoring\Dashboard.png", size=[140,140])
Sheet2['A1'] = 'This is Sid'
Sheet2.add_image(img, 'C2')
LoadFile.save("CheckReport.xlsx")
LoadFile.close()