diff --git a/sc/source/ui/vba/vbaworksheet.cxx b/sc/source/ui/vba/vbaworksheet.cxx index 8ac9cc62eecb..28c9573177c3 100644 --- a/sc/source/ui/vba/vbaworksheet.cxx +++ b/sc/source/ui/vba/vbaworksheet.cxx @@ -900,8 +900,8 @@ ScVbaWorksheet::ShowDataForm( ) throw (uno::RuntimeException, std::exception) ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "ScAbstractFactory create fail!"); - AbstractScDataFormDlg* pDlg = pFact->CreateScDataFormDlg(pTabViewShell->GetDialogParent(), - pTabViewShell); + ScopedVclPtr pDlg(pFact->CreateScDataFormDlg(pTabViewShell->GetDialogParent(), + pTabViewShell)); OSL_ENSURE(pDlg, "Dialog create fail!"); pDlg->Execute();