你好,MS CE版本的Rewrite命令,程序就崩溃,是什么原因?
调试运行到Mycell.Rewrite程序就崩溃了,但是在V8i 和V8 XM运行都没有问题。
Sub TestRenameNestCell() Dim Mycell As CellElement Dim MyEnum As ElementEnumerator sc.ExcludeAllTypes sc.IncludeType msdElementTypeCellHeader Set MyEnum = ActiveModelReference.Scan(sc) Do While MyEnum.MoveNext On Error Resume Next Set Mycell = MyEnum.Current Mycell.ResetElementEnumeration Do While Mycell.MoveToNextElement Dim ele As Element Set ele = Mycell.CopyCurrentElement If ele.IsCellElement Then ele.AsCellElement.Name = "KKK" Mycell.ReplaceCurrentElement ele End If Loop Mycell.Rewrite Loop End Sub
我查看了Bentley内部登记的错误列表,发现在MSCE版确实存在该问题:
Defect 1058050:[Regression] [From SS10] VBA method .Rewrite is raising a crash, after a text in a cell is modified using the method ReplaceCurrentElement
这个严重错误将在即将发布的MSCE-U14版消除。请耐心等待,为给您带来的不便表示抱歉!