summaryrefslogblamecommitdiffstats
path: root/macros.rst
blob: 0f25da9aca81f0d3e08b4bd49060610750d23afd (plain) (tree)
1
2
3
4
5
6




                          
                 



























































                                                                          
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`:
    http://office.microsoft.com/
.. _`Openoffice.org`:
    http://scripting.openoffice.org/
.. _`that much`:
    http://framework.openoffice.org/proposals/macro/macrorecording.html
.. _Koffice:
    http://www.koffice.org/developer/dcop/