diff options
Diffstat (limited to 'sc/source/ui/unoobj/servuno.cxx')
-rw-r--r-- | sc/source/ui/unoobj/servuno.cxx | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/sc/source/ui/unoobj/servuno.cxx b/sc/source/ui/unoobj/servuno.cxx index a173e6d1e051..0a1f86afd7d1 100644 --- a/sc/source/ui/unoobj/servuno.cxx +++ b/sc/source/ui/unoobj/servuno.cxx @@ -28,8 +28,6 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sc.hxx" - - #include <tools/debug.hxx> #include <svtools/unoimap.hxx> #include <svx/unofill.hxx> @@ -61,6 +59,7 @@ #include <sfx2/docfile.hxx> #include <sfx2/docfilt.hxx> #include <com/sun/star/script/ScriptEventDescriptor.hpp> +#include <com/sun/star/script/vba/XVBAEventProcessor.hpp> #include <com/sun/star/document/XCodeNameQuery.hpp> #include <com/sun/star/drawing/XDrawPagesSupplier.hpp> #include <com/sun/star/form/XFormsSupplier.hpp> @@ -573,6 +572,11 @@ uno::Reference<uno::XInterface> ScServiceProvider::MakeInstance( BasicManager* pAppMgr = SFX_APP()->GetBasicManager(); if ( pAppMgr ) pAppMgr->SetGlobalUNOConstant( "ThisExcelDoc", aArgs[ 0 ] ); + + // create the VBA document event processor + uno::Reference< script::vba::XVBAEventProcessor > xVbaEvents( + ::ooo::vba::createVBAUnoAPIServiceWithArgs( pDocShell, "com.sun.star.script.vba.VBASpreadsheetEventProcessor", aArgs ), uno::UNO_QUERY ); + pDocShell->GetDocument()->SetVbaEventProcessor( xVbaEvents ); } } break; |