Discussion:
[Tutor] Deleting a Row From Excel
Phillip Pugh
2015-06-19 01:28:14 UTC
Permalink
I receive several Excel documents each week. I need to delete the first row from each document (multi tabs per document). I don't see a method in the openpyxl library (using Python 3.4). am I missing something? Is there a way to delete a row from Excel.

Thanks


Phillip
_______________________________________________
Tutor maillist - ***@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
Alan Gauld
2015-06-19 09:44:07 UTC
Permalink
Post by Phillip Pugh
I need to delete the first row from each document (multi tabs per document).
Do you mean you need to delete the first row from each tab?
Or the first row from the first tab?
Post by Phillip Pugh
I don't see a method in the openpyxl library (using Python 3.4).
am I missing something? Is there a way to delete a row from Excel.
Usual caveat: This list is for the Python language and its standard
library. openpyxl is not part of the standard library so you may
get a better response on a dedicated support forum.

That having been said it is certainly possible to delete rows from excel
using the standard COM methods. You can access COM via the
ctypes module in the standard library or, rather more easily, using
PyWin32. The MSDN web site has documentation on the COM object/methods
and sample code in VB that can translate to PyWin32 fairly easily.

I have no idea whether openpyxl has an operation to do it, but it sounds
like it should have. Try asking on their support forum.

http://groups.google.com/group/openpyxl-users
--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos


_______________________________________________
Tutor maillist - ***@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
Continue reading on narkive:
Loading...