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
1
vote
2 answers

Python xlrd iteration over excel spreadsheet leaves out cell values

Need some help here guys, this is my code: import xlutils import xlrd import os import sys datafile = r'C:\\someexcelfileediting.xlsx' workbook = xlrd.open_workbook(datafile) stone = workbook.sheet_by_name(input('What is the…
Will
  • 13
  • 1
  • 3
1
vote
2 answers

How to close file after using xlutils.filter

Can anyone help me to delete an xls-file after using xlutils.filter (http://www.python-excel.org/) and fix the following error? I try to remove an excel file from the filesystem (Windows 7 64-bit) but it says: Traceback (most recent call last): …
Jellema
  • 1,912
  • 1
  • 12
  • 15
1
vote
0 answers

Compare two spreadsheets using python or perl

I like to compare two spreadsheets. Lets say file1.xls and file2.xls. I like to go compare file1 records with file2 column records. If there is a match with any particular cell I like to update a specific column on file2.xls (for example say there…
1
vote
1 answer

Python: Modifying Excel files while maintaing formatting

Is there any way to modify a few cells in an existing Excel file without losing formatting, and without using xlutils? I have access to xlwt, and xlrd, but not xlutils. Thank you!
Andrew R.
  • 25
  • 2
1
vote
1 answer

AttributeError: 'Sheet' object has no attribute 'row_len'

I'm trying to run this script and get an error: Traceback (most recent call last): File "nimeKoostaja.py", line 19, in wb = copy(book) File "/usr/local/lib/python2.7/dist-packages/xlutils/copy.py", line 13, in copy w File…
kyng
  • 457
  • 1
  • 6
  • 13
1
vote
2 answers

editing existing excel workbook using xlrd, xlwt and xlutils

How to edit and save the data in an existing excel workbook using xlrd, xlwt and xlutils module? could someone please provide a sample code to edit and save the data in excel workbook? I am trying to put data from one workbook to another. import…
user2001139
  • 49
  • 1
  • 2
  • 7
1
vote
1 answer

Writing to existing workbook

I was wondering if someone could help me out with this. I want to make changes to an existing .xls file using xlwt/xlrd/xlutils. I took a look at this question and tried the two answers at the bottom of the page. When I tried the second answer, I…
Dave
  • 503
  • 1
  • 8
  • 21
1
vote
1 answer

Python copying an entire workbook with XLRD, XLWT and XLUTILS

I simply want to copy an entire workbook. There is information to be added later which I am having no trouble finding how to add the information to single cells etc... Yet I have not found a way to copy an entire sheet. Perhaps I'm overcomplicating…
eusid
  • 769
  • 2
  • 6
  • 18
1
vote
1 answer

Preserving named ranges when copying XLS using xlutils

I have some code that opens an Excel workbook with xlrd, copies it with xlutils, updates it with xlwt and then writes it back out to another file. The resulting workbook is missing all the named ranges that were present in the original. I'm 100%…
Larry Lustig
  • 49,320
  • 14
  • 110
  • 160
0
votes
1 answer

How do we preserve Shared Workbook property settings using xlrd,xlwt & xlutils?

When I open a Shared Workbook with Multiple Edit enabled, I loose the settings while saving the file using xlwt. Here is the code which I am trying, but this do not save the shared workbook properties/settings while saving back as xls. Is there any…
Shuvan
  • 5
  • 2
0
votes
0 answers

Iterate through an excel file and randomize the column 3 data with the values from Column 1 and Column 2 - Python

I am writing a python code to read all the data in the xls file, iterate through all the elements in the excel file and randomize the C3 value for all the c3 elements within C1 and C2 value range. I have an issue with my current python code as only…
user20195885
0
votes
0 answers

How to change the color of an Excel cell without change other format/style?

I'm working on a function to edit old "xls" files, not "xlsx". I'm using packages like xlrd, xlutils and xlwt. I want change the color of a cell without change other style like Bold and Center. The color is user defined RGB color based on the input…
0
votes
1 answer

Python - Appending data from one xlsx to another existing xlsx

I have gone through many existing questions about the same, but didn't find any satisfactory answer to my problem. Here's a bunch of code for appending values from xlsx to existing xlsx: from xlutils.copy import copy import xlrd wb =…
Preetkaran Singh
  • 502
  • 5
  • 19
0
votes
1 answer

Python 3 xlutils+xlrd+xlwt

I'm struggling with editing existing xls workbook with xlrd/xlwt/xlutils I can change values in xlrd workbook, but I need to write them in existing workbook. My code doesn't work, I know that alghorytm is right, but code isn't. rb =…
Rostislav Aleev
  • 351
  • 5
  • 19
0
votes
1 answer

xlwt/xlutils.copy doesn't preserve cell (which I didn't touch) format

I am writing a python script to add a new sheet in a xls file, and I am using xlrd, xlutils.copy and xlwt to do it. Here is what my code looks like : wb=xlwt.Workbook() rb=xlrd.open_workbook(MY_FILE_PATH, formatting_info=True) wb =…
tete
  • 4,859
  • 11
  • 50
  • 81