C
catfox
Unregistered / Unconfirmed
GUEST, unregistred user!
用一下代码打开Excle文件,并排序后, 会弹出一个对话框,问是否保存,请问怎么屏蔽掉保存的对话框, thx
XLSApp := CreateOleObject('Excel.Application');
XLSApp.workBooks.Open(FileName);
Range := XLSApp.Workbooks[1].Worksheets[0 + 1].UsedRange;
SortCol := XLSApp.Workbooks[1].Worksheets[0 + 1].Range['D4', 'D4'];
Range.Sort(SortCol,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,false,NULL,NULL);
XLSApp := CreateOleObject('Excel.Application');
XLSApp.workBooks.Open(FileName);
Range := XLSApp.Workbooks[1].Worksheets[0 + 1].UsedRange;
SortCol := XLSApp.Workbooks[1].Worksheets[0 + 1].Range['D4', 'D4'];
Range.Sort(SortCol,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,false,NULL,NULL);