1 diff --git basic/source/runtime/runtime.cxx basic/source/runtime/runtime.cxx
2 index 69c75b3..93a8afd 100644
3 --- basic/source/runtime/runtime.cxx
4 +++ basic/source/runtime/runtime.cxx
5 @@ -294,7 +294,6 @@ SbiInstance::SbiInstance( StarBASIC* p )
8 bCompatibility = FALSE;
9 - SbxErrObject::getUnoErrObject()->Clear();
12 SbiInstance::~SbiInstance()
13 diff --git basic/source/runtime/step0.cxx basic/source/runtime/step0.cxx
14 index fa66194..c43931d 100644
15 --- basic/source/runtime/step0.cxx
16 +++ basic/source/runtime/step0.cxx
17 @@ -1132,6 +1132,7 @@ void SbiRuntime::StepNOERROR()
21 + SbxErrObject::getUnoErrObject()->Clear();
25 @@ -1140,6 +1141,9 @@ void SbiRuntime::StepNOERROR()
26 void SbiRuntime::StepLEAVE()
29 + // If VBA and we are leaving an ErrorHandler then clear the error ( it's been processed )
30 + if ( bInError && pError )
31 + SbxErrObject::getUnoErrObject()->Clear();
34 void SbiRuntime::StepCHANNEL() // TOS = Kanalnummer
35 diff --git basic/source/runtime/step1.cxx basic/source/runtime/step1.cxx
36 index 57d7f02..d6dc7d0 100644
37 --- basic/source/runtime/step1.cxx
38 +++ basic/source/runtime/step1.cxx
42 #include "sbunoobj.hxx"
43 +#include "errobject.hxx"
45 bool checkUnoObjectType( SbUnoObject* refVal,
46 const String& aClass );
47 @@ -374,6 +375,7 @@ void SbiRuntime::StepERRHDL( UINT32 nOp1 )
51 + SbxErrObject::getUnoErrObject()->Clear();
54 // Resume nach Fehlern (+0=statement, 1=next or Label)
55 @@ -394,6 +396,8 @@ void SbiRuntime::StepRESUME( UINT32 nOp1 )
59 + if ( pError ) // current in error handler ( and got a Resume Next statment )
60 + SbxErrObject::getUnoErrObject()->Clear();