本文介绍了Range的排序方法不可用-生成异常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
你好,
谁可以给我打电话这段代码有什么问题?
我遇到一个异常:"System.Runtime.InteropServices.SEHException"
非常感谢您
Hello,
Who can tel me what it is wrong in this code ?
I got an exception : ''System.Runtime.InteropServices.SEHException''
Thank you very much
Excel::RangePtr ptrK1 = ptrSheet->Cells->GetItem(1,3);
_variant_t K1 = _variant_t (ptrK1);
Excel::RangePtr ptrK2 = ptrSheet->Cells->GetItem(1,4);
_variant_t K2 = _variant_t (ptrK2);
Excel::RangePtr ptrK3 = ptrSheet->Cells->GetItem(1,2);
_variant_t K3 = _variant_t (ptrK3);
Excel::XlSortOrder order = Excel::xlAscending;
Excel::XlSortType typ = Excel::xlSortLabels;
Excel::XlYesNoGuess head = Excel::xlYes;
Excel::XlSortOrientation orien = Excel::xlSortRows;
Excel::XlSortMethod meth = Excel::xlPinYin;
Excel::XlSortDataOption opt1 = Excel::xlSortNormal;
Excel::XlSortDataOption opt2 = Excel::xlSortNormal;
Excel::XlSortDataOption opt3 = Excel::xlSortNormal;
const _variant_t varM = vtMissing;
//&Key1, Order1, &Key2, &Type, Order2, &Key3, Order3, Header, &OrderCustom, &MatchCase, Orientation, SortMethod, DataOption1, DataOption2, DataOption3
ptrRng->Sort (&K1, order, &K2, &varM, order, &K3, order, head, &varM, &varM, orien, meth, opt1, opt2, opt3);
已添加代码标签-LOSMAC [/EDIT]
Code tags added - LOSMAC[/EDIT]
推荐答案
这篇关于Range的排序方法不可用-生成异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!