From 6f947c50faf2969405749fc118659d9d9934eb91 Mon Sep 17 00:00:00 2001 From: Olivier Hallot Date: Wed, 17 May 2017 16:34:06 -0300 Subject: tdf#84675 (part4) document VBA macros support Change-Id: I61f60fb4f3ac27604a71972f0c1d8a7e9effdcc4 Reviewed-on: https://gerrit.libreoffice.org/37735 Reviewed-by: Olivier Hallot Tested-by: Olivier Hallot --- AllLangHelp_sbasic.mk | 2 + source/text/sbasic/shared/03103350.xhp | 71 ++++++++++++++++ source/text/sbasic/shared/main0601.xhp | 38 ++++----- source/text/sbasic/shared/vbasupport.xhp | 55 +++++++++++++ source/text/shared/optionen/01130100.xhp | 134 ++++++++++++++++++------------- 5 files changed, 227 insertions(+), 73 deletions(-) create mode 100644 source/text/sbasic/shared/03103350.xhp create mode 100644 source/text/sbasic/shared/vbasupport.xhp diff --git a/AllLangHelp_sbasic.mk b/AllLangHelp_sbasic.mk index 4ac32080be..1be0b6bbea 100644 --- a/AllLangHelp_sbasic.mk +++ b/AllLangHelp_sbasic.mk @@ -252,6 +252,7 @@ $(eval $(call gb_AllLangHelp_add_helpfiles,sbasic,\ helpcontent2/source/text/sbasic/shared/03103100 \ helpcontent2/source/text/sbasic/shared/03103200 \ helpcontent2/source/text/sbasic/shared/03103300 \ + helpcontent2/source/text/sbasic/shared/03103350 \ helpcontent2/source/text/sbasic/shared/03103400 \ helpcontent2/source/text/sbasic/shared/03103450 \ helpcontent2/source/text/sbasic/shared/03103500 \ @@ -324,6 +325,7 @@ $(eval $(call gb_AllLangHelp_add_helpfiles,sbasic,\ helpcontent2/source/text/sbasic/shared/keys \ helpcontent2/source/text/sbasic/shared/main0211 \ helpcontent2/source/text/sbasic/shared/main0601 \ + helpcontent2/source/text/sbasic/shared/vbasupport \ )) # vim: set noet sw=4 ts=4: diff --git a/source/text/sbasic/shared/03103350.xhp b/source/text/sbasic/shared/03103350.xhp new file mode 100644 index 0000000000..6cd1eb4262 --- /dev/null +++ b/source/text/sbasic/shared/03103350.xhp @@ -0,0 +1,71 @@ + + + + + + + Option VBASupport Statement [Runtime] + /text/sbasic/shared/03103350.xhp + + + + + + +
+ + MS Excel macros support;Enable + MS Excel macros support;Option VBASupport statement + VBA Support;Option VBASupport statement + Option VBASupport statement + + + +Option VBASupport Statement [Runtime] +Specifies that %PRODUCTNAME Basic will support some VBA statements, functions and objects. +
+The support for VBA is not complete, but covers a large portion of the common usage patterns. + +Syntax: + +Option VBASupport {1|0} + + +Parameters: +This statement must be added before the executable program code in a module. +1: Enable VBA support in %PRODUCTNAME +0: Disable VBA support + +Example: + +Option VBASupport 1 +Sub ExampleVBA +Dim sVar As Single + sVar = Worksheets("Sheet1").Range("A1") +Print sVar +End Sub + + +
+VBA Properties +VBA support in %PRODUCTNAME +
+ + +
\ No newline at end of file diff --git a/source/text/sbasic/shared/main0601.xhp b/source/text/sbasic/shared/main0601.xhp index 45324adca4..e9e9e50160 100644 --- a/source/text/sbasic/shared/main0601.xhp +++ b/source/text/sbasic/shared/main0601.xhp @@ -1,6 +1,5 @@ - - + +--> - - - -$[officename] Basic Help -/text/sbasic/shared/main0601.xhp - - -Sun Microsystems, Inc. - + + $[officename] Basic Help + /text/sbasic/shared/main0601.xhp + + + -%PRODUCTNAME Basic Help + +%PRODUCTNAME Basic Help +
-%PRODUCTNAME provides an Application Programming Interface (API) that allows controlling the $[officename] components with different programming languages by using the $[officename] Software Development Kit (SDK). For more information about the $[officename] API and the Software Development Kit, visit http://api.libreoffice.org -This help section explains the most common runtime functions of %PRODUCTNAME Basic. For more in-depth information please refer to the OpenOffice.org BASIC Programming Guide on the Wiki. +%PRODUCTNAME provides an Application Programming Interface (API) that allows controlling the $[officename] components with different programming languages by using the $[officename] Software Development Kit (SDK). For more information about the $[officename] API and the Software Development Kit, visit http://api.libreoffice.org +This help section explains the most common runtime functions of %PRODUCTNAME Basic. For more in-depth information please refer to the OpenOffice.org BASIC Programming Guide on the Wiki.
-Working with %PRODUCTNAME Basic + +Working with %PRODUCTNAME Basic @@ -46,7 +45,9 @@ -Help about the Help + + +Help about the Help @@ -55,4 +56,5 @@ -
+ +
\ No newline at end of file diff --git a/source/text/sbasic/shared/vbasupport.xhp b/source/text/sbasic/shared/vbasupport.xhp new file mode 100644 index 0000000000..694afd33c8 --- /dev/null +++ b/source/text/sbasic/shared/vbasupport.xhp @@ -0,0 +1,55 @@ + + + + + + + Support for VBA Macros + /text/sbasic/shared/vbasupport.xhp + + + + + + +
+ +Working with VBA Macros +Visual Basic for Applications (VBA) is an implementation of Microsoft's Visual Basic which is built into all Microsoft Office applications. +
+Support for VBA is not complete, but it covers a large portion of the common usage patterns. Most macros use a manageable subset of objects in the Excel API (such as the Range, Worksheet, Workbook, etc.) and the support include those objects, and the most commonly used method/properties of those objects. + +Loading Microsoft Office documents with executable VBA macros +Go to Tools – Options – Load / Save – VBA Properties and mark the Excutable code checkbox. Then load or open your document. + + +Runing VBA Macros +Run VBA macros in the same way as %PRODUCTNAME Basic macros. +Since support for VBA is not complete, you may have to edit the VBA code and complete the missing support with %PRODUCTNAME Basic objects, statements and functions. + +Editing VBA Macros +VBA macros can be edited in the %PRODUCTNAME Basic IDE. + +
+VBA Properties +%PRODUCTNAME Basic IDE +
+ + +
\ No newline at end of file diff --git a/source/text/shared/optionen/01130100.xhp b/source/text/shared/optionen/01130100.xhp index c0c32e4f0c..3ab6d9c1ef 100644 --- a/source/text/shared/optionen/01130100.xhp +++ b/source/text/shared/optionen/01130100.xhp @@ -1,6 +1,5 @@ - +--> - - VBA Properties - /text/shared/optionen/01130100.xhp - - - -
-Microsoft Office; importing/exporting VBA code - importing; Microsoft Office documents with VBA code - exporting; Microsoft Office documents with VBA code - loading; Microsoft Office documents with VBA code - saving; VBA code in Microsoft Office documents - VBA code; loading/saving documents with VBA code - Visual Basic for Applications; loading/saving documents with VBA code + + VBA Properties + /text/shared/optionen/01130100.xhp + + + + + + +
+ + Microsoft Office; importing/exporting VBA code + importing; Microsoft Office documents with VBA code + exporting; Microsoft Office documents with VBA code + loading; Microsoft Office documents with VBA code + saving; VBA code in Microsoft Office documents + VBA code; loading/saving documents with VBA code + Visual Basic for Applications; loading/saving documents with VBA code + -VBA Properties - Specifies the general properties for loading and saving Microsoft Office documents with VBA (Visual Basic for Applications) code. -
-
- -
- Microsoft Word 97/2000/XP - Select the settings for Microsoft Word documents. + +VBA Properties +Specifies the general properties for loading and saving Microsoft Office documents with VBA (Visual Basic for Applications) code. +
+ +
+ +
+ +Microsoft Word 97/2000/XP +Select the settings for Microsoft Word documents. -Load Basic code - Loads and saves the Basic code from a Microsoft document as a special $[officename] Basic module with the document. The disabled Microsoft Basic code is visible in the $[officename] Basic IDE between Sub and End Sub. You can edit the code. When saving the document in $[officename] format, the Basic code is saved as well. When saving in another format, the Basic code from the $[officename] Basic IDE is not saved. - + +Load Basic code +Loads and saves the Basic code from a Microsoft document as a special $[officename] Basic module with the document. The disabled Microsoft Basic code is visible in the $[officename] Basic IDE between Sub and End Sub. You can edit the code. When saving the document in $[officename] format, the Basic code is saved as well. When saving in another format, the Basic code from the $[officename] Basic IDE is not saved. -Save original Basic code -
- Specifies that the original Microsoft Basic code contained in the document is held in a special internal memory for as long as the document remains loaded in $[officename]. When saving the document in Microsoft format the Microsoft Basic is saved again with the code in an unchanged form. - When saving in another format than Microsoft Format, the Microsoft Basic Code is not saved. For example, if the document contains Microsoft Basic Code and you save it in $[officename] format, you will be warned that the Microsoft Basic Code will not be saved. - The Save original Basic code checkbox takes precedence over the Load Basic code check box. If both boxes are marked and you edit the disabled Basic Code in the $[officename] Basic IDE, the original Microsoft Basic code will be saved when saving in the Microsoft format. A message appears to inform you of this. - To remove any possible Microsoft Basic macro viruses from the Microsoft document, unmark the Save Original Basic Code check box and save the document in Microsoft format. The document will be saved without the Microsoft Basic code. -
- Microsoft Excel 97/2000/XP - Specifies the settings for documents in Microsoft Excel. - Load Basic code - + +
+ +Executable code +The VBA (Visual Basic for Applications) code will be loaded ready to be executed. If this checkbox is not checked, the VBA code will be commented out so it can be inspected, but will not run. +After loading the VBA code, %PRODUCTNAME inserts the statement Option VBASupport 1 in every Basic module to enable a limited support for VBA statements, functions and objects. See Option VBASupport Statement [Runtime] for more information. +
+ +Save original Basic code + +
+Specifies that the original Microsoft Basic code contained in the document is held in a special internal memory for as long as the document remains loaded in $[officename]. When saving the document in Microsoft format the Microsoft Basic is saved again with the code in an unchanged form. +When saving in another format than Microsoft Format, the Microsoft Basic Code is not saved. For example, if the document contains Microsoft Basic Code and you save it in $[officename] format, you will be warned that the Microsoft Basic Code will not be saved. +The Save original Basic code checkbox takes precedence over the Load Basic code check box. If both boxes are marked and you edit the disabled Basic Code in the $[officename] Basic IDE, the original Microsoft Basic code will be saved when saving in the Microsoft format. A message appears to inform you of this. +To remove any possible Microsoft Basic macro viruses from the Microsoft document, unmark the Save Original Basic Code check box and save the document in Microsoft format. The document will be saved without the Microsoft Basic code. +
+ +Microsoft Excel 97/2000/XP +Specifies the settings for documents in Microsoft Excel. + +Load Basic code + -Executable code - The VBA (Visual Basic for Applications) code will be loaded ready to be executed. If this checkbox is not checked, the VBA code will be commented out so it can be inspected, but will not run. - Save original Basic code - - Microsoft PowerPoint 97/2000/XP - Specifies the settings for documents in Microsoft PowerPoint. - Load Basic code - - Save original Basic code - -
- - - Setting the default file format -
- -
+ + +Save original Basic code + + +Microsoft PowerPoint 97/2000/XP +Specifies the settings for documents in Microsoft PowerPoint. + +Load Basic code + + +Save original Basic code + + +
+ + +Setting the default file format +VBA support in %PRODUCTNAME +
+ + + \ No newline at end of file -- cgit