Range的排序方法不可用-生成异常 [英] Sort method of Range unusable - generate an exception

查看:73
本文介绍了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]

推荐答案

Hello

它是排序指令本身.
例外是excel.tli文件中的5812行.
在自动机"视图调试中,对于&Key1,存在错误:无法获取值";其他所有参数_variant_t相同.

并且显示的文本是:

类型为"System.Runtime.InteropServices.SEHException"的例外
信息供应商:弱者根本没有征税.

谢谢
Hello

It is the sort instruction itself.
The exception is at the line 5812 in the excel.tli file.
In the "automatique" view debug, for the &Key1 there is "error:cannot obtain value"; it is the same for all others parameters _variant_t.

and the displayed text is :

Une exception non gérée du type ''System.Runtime.InteropServices.SEHException'' s''est produite dans traitementfichiersoab.exe

Informations supplémentaires : Un composant externe a levé une exception.

thank you


这篇关于Range的排序方法不可用-生成异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆