0

I have one xls file named template.xls,which has some style and values,i want to insert a value in template.xls.How can i do this?

Ashok
  • 41
  • 1
  • 6

1 Answers1

-1

There's already a thread related to your specific question.

https://stackoverflow.com/a/26958437/8751278

You should utilize this (from abaldwin99):

#xlrd, xlutils and xlwt modules need to be installed.  
#Can be done via pip install <module>
from xlrd import open_workbook
from xlutils.copy import copy

rb = open_workbook("names.xls")
wb = copy(rb)

s = wb.get_sheet(0)
s.write(0,0,'A1')
wb.save('names.xls')

However, you need to install the modules before it works.

It pretty much replaces the very top-left value and sets it to 'A1'.

You, of course, need to change 'names.xls' with your own file's name.