Questions tagged [xlutils]

xlutils allows you to copy and modify Excel files writing Excel 2003 files.

xlutils is based on and and allows for modifying (not in place, complete files are written) Excel files. It is limited by the underlying libraries and therefore can read Excel 2007, but cannot write that format (.xlsx, .xlsm).

Documentation: http://pythonhosted.org/xlutils/

88 questions
2
votes
0 answers

How to copy hyperlinks using xlrd, xlwt and xlutils?

Problem: I am trying a simple code for writting excel sheet. The program checks if the Excel sheet already exists, If the file exists, then it append it with the new data. The problem is I am unable to copy hyperlinks as xlrd fail to read…
2
votes
1 answer

Duplicate worksheets using xlwt

I'm trying to convert a config file into an Excel file using xlwt. Getting an error because of duplicate worksheets. The config file is massive, I want to merge the duplicate worksheets . Is there a way to go around it? Thanks
osrrev
  • 51
  • 1
  • 5
2
votes
1 answer

python xlutils/xlwt/xlrd/excel - can't modify copied worksheets

I'm strugging with xlutils and copying a worksheet. The code below successfully copies the first worksheet and adds 2 copies, however when I write to each worksheet it applies the changes to all worksheet copies and also the original. So the…
Joe
  • 1,762
  • 9
  • 43
  • 60
2
votes
1 answer

Iterating over rows in a column with XLRD

I have been able to get the column to output the values of the column in a separated list. However I need to retain these values and use them one by one to perform an Amazon lookup with them. The amazon lookup is not the problem. Getting XLRD to…
eusid
  • 769
  • 2
  • 6
  • 18
1
vote
0 answers

How do I store multiple XLWT worksheets in a single excel file as separate sheets/tabs and preserve the formatting?

def _getOutCell(outSheet, colIndex, rowIndex): row = outSheet._Worksheet__rows.get(rowIndex) if not row: return None cell = row._Row__cells.get(colIndex) return cell def setOutCell(outSheet, col, row, value): """ Change cell…
1
vote
2 answers

How to search and replace string in excel (.xls) file using Python?

i am trying to use search and replace string in excel file (xls), actually - i need to find string and add before prefix * . For example But i am getting a error: LVdemact = {'two': two_replaced, 'six': six_replaced, 'five':…
1
vote
0 answers

Finding the range of a list and using it as a parameter in Python

I am attempting to use the range of a list, specifically col_test and then I would like to use that range to specify the cells to be filled on the new worksheet. I want the list col_test to fill the second column in the new sheet starting at row…
geojasm
  • 121
  • 9
1
vote
1 answer

compare 2 cells and update result in another cell in excel using xlwt python

I have excel that col A and col B like below: A B KIWI KIWI APPLE APPLE ORANGE BANANA I need to compare the contents in col A and col B and if they matches write match/not match in col C like below. A B C KIWI …
1
vote
2 answers

Python writing (xlwt) to an existing Excel Sheet, drops charts and formatting

Am using python to automate some tasks and ultimately write to an existing spreadsheet. Am using the xlwt, xlrd and xlutils modules. So the way I set it up is to open the file, make a copy, write to it and then save it back to the same file. When I…
HAMIN
  • 31
  • 1
  • 5
1
vote
1 answer

Python - xlutils "filter.py" syntax error - print repr(self.name)

I developing a script that will eventually use a pdfminer package to convert .pdfs to .txt files. In preparing the the subject files for use, I am having to import copy from xlutils.copy from xlutils.copy import copy, I run into a syntax error from…
1
vote
2 answers

Modifying and writing data in an existing excel file using Python

I have an Excel file(xlsx) that already has lots of data in it. Now I am trying to use Python to write new data into this Excel file. I looked at xlwt, xldd, xlutils, and openpyxl, all of these modules requires you to load the data of my excel…
Jerry Shi
  • 43
  • 1
  • 4
1
vote
1 answer

OpenPyXL always return None for a cell with hyperlink

(My ultimate purpose is to append clickable cells to existing XLSX.) I use the code below to extract the cell's display value and the hyperlink. from openpyxl import load_workbook xlsFile='hello.xlsx' wbook = load_workbook(xlsFile) wsheet1=…
smwikipedia
  • 61,609
  • 92
  • 309
  • 482
1
vote
0 answers

How to copy an existing worksheet and multi-paste it in the same workbook using xlrd, xlwt, and xlutils

I have an excel template file dot xlt extension. I want to make a program using python (xlrd, xlwt, and xlutils) where it will copy the existing template to the new workbook (distinct name). Then the wokrbook will have a sheet as the template. My…
Joni
  • 21
  • 4
1
vote
1 answer

Xlrd, xlwt, and xlutils: how do they work together

I'm trying to write to an existing xls file and then iterate over rows of the same file until I find a blank. I understand how to do this via code. Now my question is, does xlrd "update" it's reference to the sheet? Or do I have to create a new xlrd…
ohbrobig
  • 939
  • 2
  • 13
  • 34
1
vote
0 answers

"Licences" module not found by xlrd

I've installed xlutils and am trying the following code: from xlrd import open_workbook input_file = open_workbook('DataTestFile.xlsx') for s in input_file.sheets(): print('Sheet:',s.name) for row in range(s.nrows): values = [] …
PrincessLilly
  • 415
  • 1
  • 8
  • 21