469,579 Members | 1,161 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,579 developers. It's quick & easy.

sort in Excel

MK
Hello,

Does anyone knows how to use the Excel sort function in python?

Apr 16 '06 #1
1 6187
MK
u do it like this:

from win32com.client import Dispatch
xlApp = Dispatch("Excel.Application")
xlApp.Workbooks.Open("D:\python\sortme.csv")
xlApp.Range("A1:C100").Sort(Key1=xlApp.Range("B1") , Order1=2)
xlApp.ActiveWorkbook.Close(SaveChanges=1)
xlApp.Quit()
del xlApp

Apr 16 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by Dr. Ann Huxtable | last post: by
1 post views Thread by deko | last post: by
1 post views Thread by nate axtell | last post: by
reply views Thread by suresh191 | last post: by
4 posts views Thread by guiromero | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.