Excel Styles.IndentLevel->运行时错误94:无效使用Null

时间:2017-11-02 05:30:11

标签: vba excel-vba excel

描述

检查样式的未启动textInputLayout.setHintTextAppearance(R.style.text_in_layout_hint_Style); 会抛出运行时错误94:无效使用Null

  

如果ThisWorkbook.Styles(1).IndentLevel则

检查样式func numberOfSections(in collectionView: UICollectionView) -> Int { return 1 } func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { return results.count } func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { print("Cell For Row -> \(indexPath)") let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "ResultCell", for: indexPath) as! ResultCell cell.data = result[indexPath.item] return cell } .IndentLevel的未启动.IndentLevel是否也会抛出运行时错误94:无效使用空

  

如果是IsNull(ThisWorkbook.Styles(1).IndentLevel)那么   如果是IsError(ThisWorkbook.Styles(1).IndentLevel)那么

enter image description here

解决方法

IsNull

测试代码

IsError

实际问题

这是On Error Resume Next Call IsNull(ThisWorkbook.Styles(1).IndentLevel) If Err.Number <> 0 Then End If On Error GoTo 0 属性本身内部未处理的Sub TestIndent() With ThisWorkbook.Styles.Add("Test - IndentLevel") On Error Resume Next Debug.Print .IndentLevel If Err.Number <> 0 Then Debug.Print "Error - .IndentLevel:"; .Err.Number, Err.Description Err.Clear Debug.Print IsNull(.IndentLevel) If Err.Number <> 0 Then Debug.Print "Error - IsNull(.IndentLevel):"; Err.Number, Err.Description On Error GoTo 0 .IndentLevel = 1 Debug.Print "No Error - .IndentLevel:"; .IndentLevel Debug.Print "No Error - IsNull(.IndentLevel)"; IsNull(.IndentLevel) .Delete End With End Sub 错误吗?

0 个答案:

没有答案