Skip to content

Instantly share code, notes, and snippets.

@fereria
Created August 21, 2015 11:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fereria/57bdd6a5c4f3d9e3ed32 to your computer and use it in GitHub Desktop.
Save fereria/57bdd6a5c4f3d9e3ed32 to your computer and use it in GitHub Desktop.
SortTest
## -*- coding: utf-8 -*-
import win32com.client as win32
#Excel内のEnum型を取得する
x = win32.gencache.EnsureDispatch("Excel.Application")
xlApp = win32.Dispatch("Excel.Application")
excelFile = "E:/textExcelB.xlsx"
wb = xlApp.Workbooks.Open(excelFile)
sheet = wb.Worksheets(1)
sheet.Range("A1:A10").Sort(Key1=sheet.Range("A1"),Order1=1, Header=1, Orientation=1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment