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
1 answer

How to go about copying a subsection of "xlsx" file into a new sheet?

So here is the challenge I am facing. I want to copy a certain range of rows and columns from one sheet in a workbook into a new sheet. Seems pretty easy enough right? Here's the catch: The entire process has to be done using python and the copying…
2
votes
1 answer

Error when trying to use module load_workbook from openpyxl

I'm attempting to open an xlsx-file using load_workbook from the module openpyxl. The code I have is: import os from openpyxl import load_workbook def edit_workbook(): path = r'C:\123 ABC\Excel documents' filename = 'filename.xlsx' …
Stewie Griffin
  • 14,889
  • 11
  • 39
  • 70
2
votes
1 answer

xlutils only works on xls, not xlsx?

I have an existing Excel workbook, Workbook_A. I'm creating an identical workbook, Workbook_B, and then insert a few values into some of the cells in the new workbook. A simplified version of what I'm doing: from xlrd import open_workbook from…
Stewie Griffin
  • 14,889
  • 11
  • 39
  • 70
2
votes
2 answers

Copying only worksheet of XLS to become new worksheet in new XLS using Python?

Using the Python test code below I am trying to copy the only worksheet in an Excel (*.xls) file into a new Excel file with one worksheet. The input spreadsheet looks like: from copy import deepcopy from xlrd import open_workbook from xlutils.copy…
PolyGeo
  • 1,340
  • 3
  • 26
  • 59
2
votes
2 answers

How to enter values to an .xlsx file and keep formatting of cells

I have a results analysing spreadsheet where i need to enter my raw data into a 8x6 cell 'plate' which has formatted cells to produce the output based on a graph created. This .xlsx file is heavily formatted with formulas for the analysis, and it is…
trouselife
  • 971
  • 14
  • 36
2
votes
0 answers

Editing an existing xls file in python without losing styling / color

I need to modify some one specific worksheet in an existing xls file and then save it again , using python. The commonly suggested modules , openpyxl and xlsxwriter , do not support the older xls format. I tried using the combination of xlrd,…
2
votes
1 answer

How do xlrd, xlwt, xlutils work with Excel in the low level?

They are all open source Python packages to control Excel (see python-excel). I am still trying to understand their code. If anyone could give a hint, do how they connect in a low lever to Excel? Via xml, Excel API, or some other basic Python…
SoftTimur
  • 5,630
  • 38
  • 140
  • 292
2
votes
0 answers

Read from an excel cell & write to another excel sheet applying the same format in python xlrd/xlwt

I am using the xlrd, xlwt & xlutils library in python to read & write from an excel sheet. So, I have successfully read & written to the excel sheet. But I need some directions in capturing the format of the cell I am reading from & applying the…
0nir
  • 1,345
  • 4
  • 20
  • 41
2
votes
2 answers

Issues in preserving Excel formatting with Python's xlrd and xlutils

Simply put, I would like to preserve all of the formatting of one Excel file into another. However, despite using the formatting_info=True flag, the formatting only appears for all of the unchanged cells within the changed row. Any advice? import…
user1185790
  • 623
  • 8
  • 24
2
votes
1 answer

Including xlrd/xlwt/xlutils with modules outside of python installation

I'm self-taught in the Python world, so some of the structural conventions are still a little hazy to me. However, I've been getting very close to what I want to accomplish, but just ran into a larger problem. Basically, I have a directory…
mr.adam
  • 241
  • 2
  • 12
2
votes
0 answers

Modify .xls file with python

Im coding a script in python that reads a excel file, then makes a change on a cell and then it copy all to another excel file and save it. For example i have example.xls, then i generate example_copy.xls. everuthing is the same, but my problem is,…
Jesús Cota
  • 515
  • 1
  • 4
  • 14
2
votes
1 answer

Copy Sheets with xlrd/xlutils

I have a folder with many excel files of the same format, with multiple sheets. The goal is to loop through the folder and move one of the sheets in each notebook to an new notebook i.e. ending up one sheet from each .xlsx file in the new workbook.…
Woody Pride
  • 13,539
  • 9
  • 48
  • 62
2
votes
0 answers

Using xlutils xlwt to copy workbook

Is it possible to copy a macros enabled excel workbook? For example, I have: from xlutils.copy import copy from xlrd import open_workbook from tempfile import TemporaryFile book = open_workbook("book.xlsm") book_copy =…
user3204260
  • 115
  • 4
  • 11
2
votes
2 answers

Why does this Python loop fail to output to the next available excel row?

First and foremost: thanks for any help in advance. I'm a total programming novice, and my code will reflect that. I'll attempt to describe what I'm attempting to do, and display the code. Again, thank you for your time and explanations. The…
X5748
  • 23
  • 4
2
votes
1 answer

Compare incomplete date list with a reference date list

I know this is possible. I know there is a simple solution, but everything I've tried has failed. Here's the deal: I have a dataset in Excel format containing 939,019 weather station records (rows). The date/time interval is every 10 minutes…
mandeno
  • 21
  • 1