1

I was wondering if its possible to write text into a cell that lies in a xlsm file using xlsxwriter? I have tried to do it on my own but it corrupts my workbook. Any ideas? My code is

import xlsxwriter

text = 'hola amigos'

book = xlsxwriter.Workbook('file.xlsm')

sheet = book.add_worksheet()

sheet.write_string(0,0,text)

book.close()
Warcupine
  • 4,460
  • 3
  • 15
  • 24
  • That code does *NOT* create an `xlsm` file. That creates an `xlsx` with the wrong extension. Check [Working with Macros](https://xlsxwriter.readthedocs.io/working_with_macros.html) in the XlsxWriter docs – Panagiotis Kanavos Aug 02 '21 at 14:55

0 Answers0