I am using pywin32 module to add an excel file as an object in another excel file, I need to get the label added to it as Europe in the object. Even after adding the parameter IconLabel in code, I don't see any caption in the object attached to Excel, can anyone please let me know what is wrong in the code?
Here is the following Code I have used:
import win32com.client as win32
import sys
Filename=str(sys.argv[1])
Sheetname=str(sys.argv[2])
Filename2=str(sys.argv[3])
xl = win32.gencache.EnsureDispatch('Excel.Application')
wb=xl.Workbooks.Open(Filename)
ws=wb.Worksheets(Sheetname)
dest_cell=ws.Range("A1")
obj = ws.OLEObjects()
obj.Add(Filename=Filename2,Link=False,DisplayAsIcon=True,IconLabel="Europe",Left=dest_cell.Left,Top=dest_cell.Top)
wb.Save()
xl.Application.Quit()