[Tutor] Deleting a Row From Excel

Alan Gauld alan.gauld at btinternet.com
Fri Jun 19 11:44:07 CEST 2015


On 19/06/15 02:28, Phillip Pugh wrote:
> 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?

> 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




More information about the Tutor mailing list