summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sc/source/filter/oox/workbookhelper.cxx13
1 files changed, 7 insertions, 6 deletions
diff --git a/sc/source/filter/oox/workbookhelper.cxx b/sc/source/filter/oox/workbookhelper.cxx
index 15b676aa68f0..59c87c53b993 100644
--- a/sc/source/filter/oox/workbookhelper.cxx
+++ b/sc/source/filter/oox/workbookhelper.cxx
@@ -751,6 +751,13 @@ void WorkbookHelper::finalizeWorkbookImport()
mrBookGlob.getWorkbookSettings().finalizeImport();
mrBookGlob.getViewSettings().finalizeImport();
+ // Import the VBA project (after finalizing workbook settings which
+ // contains the workbook code name). Do it before processing formulas in
+ // order to correctly resolve VBA custom function names.
+ StorageRef xVbaPrjStrg = mrBookGlob.getVbaProjectStorage();
+ if( xVbaPrjStrg.get() && xVbaPrjStrg->isStorage() )
+ getBaseFilter().getVbaProject().importModulesAndForms( *xVbaPrjStrg, getBaseFilter().getGraphicHelper() );
+
// need to import formulas before scenarios
mrBookGlob.getFormulaBuffer().finalizeImport();
@@ -770,12 +777,6 @@ void WorkbookHelper::finalizeWorkbookImport()
sheets. Automatic numbering is set by passing the value 0. */
PropertySet aDefPageStyle( getStyleObject( "Default", true ) );
aDefPageStyle.setProperty< sal_Int16 >( PROP_FirstPageNumber, 0 );
-
- /* Import the VBA project (after finalizing workbook settings which
- contains the workbook code name). */
- StorageRef xVbaPrjStrg = mrBookGlob.getVbaProjectStorage();
- if( xVbaPrjStrg.get() && xVbaPrjStrg->isStorage() )
- getBaseFilter().getVbaProject().importModulesAndForms( *xVbaPrjStrg, getBaseFilter().getGraphicHelper() );
}
// document model -------------------------------------------------------------