summaryrefslogtreecommitdiffstats
path: root/computer/macros.rst
blob: 89e51667c9c78643d981370528c16012a64f43c7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
Bitching about macros
#####################

:date: 2005-10-07T10:20:00
:category: computer
:tags: OpenOffice

After many years I got to work with `M$ Office`_ again and I got in
contact with one of my old feelings about various Linux office suites
(`Openoffice.org`_ may be slightly exception, but not `that much`_)—none
of them is suitable for high-level professional business work, because
they all fail in providing functional user macros. I mean real macros
for normal users who need to make their work goes faster by eliminating
repetitive tasks. Take this one Excel macro as an example:

::

    Sub CleanMissingJobCode()
    '
    ' CleanMissingJobCode Macro
    ' Macro recorded 10/5/2005 by mcepl
    '
    ' Keyboard Shortcut: Ctrl+Shift+X
    '
        Application.ScreenUpdating = False
        Selection.Cut
        Selection.End(xlToRight).Select
        ActiveCell.Offset(0, 1).Select
        Selection.End(xlUp).Select
        ActiveCell.Offset(1, 0).Select
        ActiveSheet.Paste
        Selection.End(xlToLeft).Select
        Selection.End(xlDown).Select
        ActiveCell.Offset(1, 0).Select
        Selection.Delete Shift:=xlUp
        Selection.End(xlToRight).Select
        Range(Selection, Selection.End(xlDown)).Select
        Selection.ClearContents
        Range(Selection.Offset(-1, 0), _
        Selection.Offset(0, 0)).Select
        Selection.FillDown
        ActiveCell.Offset(1, 0).Select
        ActiveCell.End(xlToLeft).Select
        Application.ScreenUpdating = True
    End Sub

I don’t show this macro here, because of its beauty, but on the contrary
for its complete ugliness. The point is that although it is just result
of macro recording and a little cleaning afterwards (Excel’s Macro
Recorder put a lot of absolute references into the script) it *just
works(TM)*. Whenever I looked at macro facilities (or rather their bare
foundations) for Koffice_, it seemed like a foundation for “real
work”, i.e., programmer who would open his IDE, debbuger and other
development tools, and begin to develop some custom application based on
the office suite, using a lot of complicated DCOP calls etc. But I do
not want to do anything significant with macros—just make my spreadsheet
do some work for me!

.. _`M$ Office`:
    https://products.office.com/en-US/
.. _`Openoffice.org`:
    http://scripting.openoffice.org/
.. _`that much`:
    http://www.openoffice.org/framework/proposals/macro/macrorecording.html
.. _Koffice:
    http://www.koffice.org/developer/dcop/