• Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
    Be the first to like this
No Downloads

Views

Total Views
2,496
On Slideshare
0
From Embeds
0
Number of Embeds
0

Actions

Shares
Downloads
32
Comments
0
Likes
0

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. Improved VBA Support
      • Noel Power
      • [email_address]
  • 2. Introduction
    • About Me
      • Working/hacking Openoffice.org ~ 4 years
      • working on VBA interoperability
    • A Bit of History
      • Started in response to customer demand
      • Various people have stuck there hand in here and there
      • Releases
        • SUSE 10.1 ( first appearance )
        • SUSE SLED 10 ( first supported version )
      • Started VBA Interoperability incubator project
        • http://vba.openoffice.org or
        • http://wiki.services.openoffice.org/wiki/VBA
  • 3. Project Update
    • Novell & Sun work together
        • http://blogs.sun.com/GullFOSS/entry/sun_and_novell_work_together
    • Sun opensources the Microsoft Office Macro Runtime Library ( MORL )
        • thanks to Michael Meeks, Kai Ramme, Juergen Schmidt, Andreas Bregas
        • http://bonsai.go-oo.org/rview.cgi?cvsroot=/home/ooweb/cvsup&dir=api/helperapi&module=OpenOffice
    • Andreas Bregas joins the project as co-lead
  • 4. What does this cooperation mean for VBA interoperability
    • Eventually we can have a single solution.
    • Pluggability
    • MORL provides a Java uno implementation code that can be ported to C++.
    • MORL has some test documents and associated infrastructure ( logging support ) that we can reuse.
    • The promise of addressing Word macros in the future.
  • 5. Where are we
    • Architecture changes
      • vba interoperability delivered either as
        • a standalone extension
        • built into openoffice itself
        • key objects are services ( new style )
        • internal namespace changes to allow extension for word support
    • Porting
      • To aid porting from the helperapi ( MORL ) C++ code now provides a XHelperInterface ( we should perhaps provide an XUnoAccess interface... takers? )
      • Constants are now generated from meta-data ( thanks to Jan Holesovsky (kendy) for perlification )
      • A good few classes have been fully or partially ported from MORL
  • 6.
    • UpStreaming
      • many vba compatibility issues have been addressed in various abxxx and npowerxxx cws(s) like..
      • Planned for OOo 2.4
        • npower7 – stack of vba compatibility issues resolved
        • npower8 – object module changes, sync with ooo-build, some MORL porting
  • 7. What's Next
    • Object modules ( Sheet, Workbook, perhaps even support for 'simple' Form modules )
    • Change how compatibility is handled
        • aim for no more 'option VBASupport 1' type nonsense
        • compatibility from the 'document' basic manager down rather than the module level
    • Application specific Dialog/UserForm controls ( longer term goal )
    • Event handling, faking compatible events for controls and controls on Userforms
    • support for Error Object, e.g.
      • Error.raise “some descriptive text”
  • 8. What can you do to help
    • Get involved
      • irc, #go-oo { me = noelp }, mail noel.power@novell.com
      • http://wiki.services.openoffice.org/wiki/VBA
    • Identify missing api & test existing api
      • some basic tests at ooo-build/tests/macros
      • cws npower8 will include some test documents
    • Help port MORL to c++
        • http://wiki.services.openoffice.org/wiki/Porting_notes#Calc_Objects_to_port
        • http://wiki.services.openoffice.org/wiki/Porting_notes#Hints_for_porting_idl
  • 9.
    • How have we done.... ( lets see how far we have got in relation to the issues identified in last years presentation at OOCon )
      • http://marketing.openoffice.org/ooocon2006/presentations/tuesday_g1.odp
  • 10. Upstreaming
    • Not enough hacks upstreamed yet
    • Option VBASupport
      • provides a basic indicator that interoperability is 'on'
      • used a hook internally in the basic engine
    • css::com::ArrayWrapper
      • multi-dimensional array support for Objects
      • influence the base of the Array regardless of the Module 'Option Base' setting
    • Array(...) function & Option Base
    • Support a 'default method' concept
  • 11. What needs to be upstreamed
    • Dim r1 as Range
    • Set and assignment for vba objects
    • Most vba constants are available ( maho )
    • Default properties { LHS & RHS }
    • Global objects
      • Application, Sheets...
    • Compatibility API
      • Range, Workbook, Worksheet...
    • Better event support
      • Excel toolbox controls, shapes, images, workbook, worksheet
    • Larger basic module support
  • 12. VBA exotics
    • set r1 = Range ( “a1” )
    • r1 = “foo” ' value of cell A1 is set to “foo”
    • dim aVar as String ' or variant
    • 'aVar wil contain “foo”
    • aVar = r1
    • 'Collections
    • dSheets = Worksheets ' global
    • wrb = dSheets( 1 )
    • wrb = dSheets.Item( 1 )
    • wrb = dSheets.( "Sheet1" )
    • wrb = dSheets.Item( "Sheet1" )
  • 13. Whats Next
    • Basic Support for Userforms & Controls
      • tie Userform module to Dialog
      • allow contols to be accessed from Worksheet
        • Sheet(1).CommandButton1
        • Sheet(1).MyComboxBox.AddItem( ListItem )
    • Compatibile Array handling
      • array of array syntax myarray(2)(3)
      • copy by value
    • Import internal Collection class
      • handle string key in Item & add methods
    • Generally Improve API coverage
    • More document analysis
  • 14.
    • Andreas Bregas
      • Software Engineer
        • Sun Microsystems, Inc.
    Improved VBA support
    • OOoCon 2007 Barcelona
  • 15. Introduction
    • About me
      • Working for Sun Microsystems (Star Division) for 12 years
      • Responsible for
        • OOo Basic core (compiler, runtime system)
        • OOo Basic IDE, Dialog Editor, Scripting Framework, ...
      • Joined VBA Interoperability incubator project as co-lead in February 2007, focussing on
        • Extending OOo Basic core to support missing VBA functionality
        • Fixing VBA compatibility related problems
        • Reviewing patches containing Basic core changes
  • 16. Extending OOo Basic functionality
    • Original reference for OOo Basic was VB 4.0
      • VB(A) >4.0 features are missing
      • Compatibility to VBA is not 100%, many small issues
    • Examples for Basic core related issues
      • Done: Class support feature, Modules > 64K
      • Done: Many new Runtime Functions
      • Done: Many fixes of Runtime Function behavior
      • Todo: Class support / event handling for Userforms
      • Todo: Support array of array syntax
      • Todo: Basic core support for “VBA exotics”
  • 17. Microsoft Office Macro Runtime Library (MORL)
    • Emerged from Sun internal Macro Migration project
    • Developed for some years with much effort
    • With the start of the VBA interoperability project there were two parallel approaches
    • To support a single open solution Sun decided to join the VBA interoperability project
    • MORL was made open source
  • 18. Microsoft Office Macro Runtime Library (MORL)
    • VBA API is described as UNO API
    • VBA API is implemented in Java, ~3,5 MB of code
    • Covers about a big part of the Word and Excel API
      • ~1100/1500 Word symbols
      • ~1000/1100 Excel symbols
    • Needs Macro Migration Tool to adapt VBA sources
  • 19. MORL versus VBA Interoperability
  • 20. Using MORL for VBA interoperability
    • Use Java code as template to extend C++
      • Already started for Excel
    • Use both, taking some symbols from MORL, other symbols VBA interoperability solution
      • Technically very difficult
      • Unfavorable mixture of different approaches
    • Use MORL for Word only
      • Could be reasonable as a temporary solution
      • Would require some changes, both in MORL as in VBA interoperability library
  • 21. Todos for using MORL for Word
    • MORL: Get rid of source code migration step
      • General Application object instead of Application.Writer
      • Support all other global objects like ActiveDocument , ActiveWindow , Documents without using a Basic library
      • Direct support for VBA constants, e.g. wdYellow instead of com.sun.star.helper.wdYellow
      • Get rid of Option Compatible , CompatibilityMode()
    • VBA interoperability library
      • Support intelligent Application object to distinguish between Word and Excel API according to the current document type
  • 22. Improved VBA support
    • Andreas Bregas
      • [email_address]