1,216
社区成员
发帖
与我相关
我的任务
分享
On Error GoTo Err_lbl
Set ExcelApp = CreateObject("Excel.Application") '创建EXCEL对象
Set ExcelBook = ExcelApp.Workbooks.Open(strPath)
Set ExcelSheet = ExcelBook.Worksheets(1) '生成凭证后的ID
ExcelSheet.Range("A2:J10").Sort Key1:=Range("J2"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, SortMethod _
:=xlPinYin, DataOption1:=xlSortNormal
ExcelBook.SaveAs ("C:\AAAAAAAA.xls")
Err_lbl:
strGroup = Err.Description
ExcelBook.Close (True)
ExcelApp.Quit
Set ExcelBook = Nothing
Set ExcelApp = Nothing