Est. 1985 Beginner

StarBasic

The built-in BASIC macro and automation language of the StarOffice office suite, ancestor of today's OpenOffice Basic and LibreOffice Basic

Created by Star Division (company founded by Marco Börries); later Sun Microsystems

Paradigm Procedural; event-driven and object-based automation via the UNO API
Typing Dynamic by default, with optional explicit typing (Dim ... As); weakly typed with a Variant type
First Appeared Lineage from 1985 (StarWriter / StarOffice); the BASIC macro language matured through the StarOffice suite in the 1990s
Latest Version Maintained as LibreOffice Basic (LibreOffice 26.2, February 2026) and Apache OpenOffice Basic

StarBasic (also written StarOffice Basic) is the built-in BASIC dialect used to write macros and automate the StarOffice office suite. It is the direct ancestor of today’s OpenOffice Basic (in Apache OpenOffice) and LibreOffice Basic, all of which share the same core language and the same way of driving an office application through its component object model. Rather than being a general-purpose programming language, StarBasic is a domain-specific automation language: its reason for existing is to give users a familiar, approachable way to script word processing, spreadsheets, presentations, and databases from inside the suite itself.

A note on dating

The metadata year 1985 reflects the lineage of StarBasic, not a release of the macro language in isolation. 1985 is when Marco Börries wrote StarWriter 1.0, the word processor that grew into StarOffice — the suite that hosts StarBasic — and also the year he founded Star Division in Lüneburg.

The BASIC macro language itself is inseparable from that suite and matured as StarOffice grew from a single word processor into an integrated office package during the 1990s. Precise “first version” attribution for the macro language is not cleanly documented in the public record, so this page treats StarBasic as the BASIC of the StarOffice family, with a lineage beginning in 1985 and well-documented programming guides appearing by the StarOffice 5.x–6.0 era (around 2000–2002). Where an exact date for the language’s introduction is uncertain, treat the framing above as approximate.

History & Origins

Star Division was a German software company founded in 1985 in Lüneburg by Marco Börries, who as a teenager wrote the first StarWriter that same year for the Zilog Z80. Over the following decade StarWriter expanded into a full suite: by StarOffice 2.0 (around 1994) it had gained the StarCalc spreadsheet and StarBase database, and StarOffice 3.0 (around 1995) shipped as a cross-platform, integrated office package spanning MS-DOS, Windows, OS/2, and Solaris.

As the suite became a collection of cooperating applications, it needed a scripting language to automate them — and, in the tradition of office software of the era, that language was a dialect of BASIC. This is StarBasic: an easy-to-learn, procedural language embedded in the suite, complete with a macro recorder and an integrated editor.

In 1999, Sun Microsystems acquired Star Division for roughly US$59.5 million. In 2000, Sun released the StarOffice codebase as the open-source OpenOffice.org project. From that point the macro language lived a double life: it remained StarOffice Basic in the commercial StarOffice product and became OpenOffice Basic (sometimes OOoBasic) in the community suite. When The Document Foundation forked OpenOffice.org into LibreOffice in 2010, the same language continued as LibreOffice Basic. Oracle (which had acquired Sun) discontinued the commercial StarOffice line — briefly rebranded Oracle Open Office — in 2011 and donated OpenOffice.org to the Apache Software Foundation.

Design Philosophy

StarBasic follows the classic philosophy of office macro languages: make automation accessible to non-programmers while still being powerful enough for serious work. Its guiding ideas are:

  • Familiarity. The syntax is deliberately BASIC-like and closely resembles Microsoft’s Visual Basic for Applications (VBA), lowering the barrier for anyone who has scripted Microsoft Office. The language is similar to VBA even though the underlying API is very different.
  • Record, then refine. Users can record actions into a macro and then open and edit that macro, learning by example and gradually writing more sophisticated code.
  • The suite as an object model. StarBasic’s real power comes from UNO (Universal Network Objects), the component model that exposes every part of the office suite — documents, sheets, text ranges, dialogs, database connections — as scriptable objects.

Key Features

  • BASIC syntax with optional typing. Variables are dynamic by default but can be declared with explicit types (Dim x As Integer). Option Explicit enforces declarations. The language is weakly typed and includes a Variant-style catch-all type.
  • Procedures and functions. Code is organized into Sub and Function routines, grouped into modules that live inside libraries attached to a document or to the application.
  • Integrated development environment (IDE). The suite includes a built-in Basic IDE for writing code, designing dialog boxes, setting breakpoints, and stepping through macros.
  • Dialog and form design. StarBasic can build and drive custom dialog boxes, giving macros a graphical user interface.
  • The UNO API. Through UNO, StarBasic reaches the full Universal Network Objects API — the same object model used by other bindings such as Java, C++, and Python — to manipulate documents and the application itself.
  • Cross-application scope. A single language automates Writer (word processing), Calc (spreadsheets), Impress (presentations), Draw, and Base (databases).

A taste of the syntax

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
Sub HelloWorld
    ' A minimal StarBasic macro
    MsgBox "Hello, World!"
End Sub

Sub WriteToCalc
    ' Access the current document through the UNO API
    Dim oSheet As Object
    Dim oCell As Object
    oSheet = ThisComponent.Sheets.getByIndex(0)
    oCell = oSheet.getCellByPosition(0, 0)  ' cell A1
    oCell.setString("Automated with StarBasic")
End Sub

The ThisComponent object and the getByIndex / getCellByPosition calls are all part of the UNO object model — the layer that distinguishes StarBasic from a generic BASIC and connects the language to the running office application.

Evolution

EraName of the languageHost suiteApproximate period
Star Division / Sun (commercial)StarOffice Basic / StarBasicStarOffice1990s – 2011
Open-source communityOpenOffice Basic (OOoBasic)OpenOffice.org2000 – 2011
ApacheApache OpenOffice BasicApache OpenOffice2012 – present
The Document FoundationLibreOffice BasicLibreOffice2010 – present

The remarkable thing about StarBasic is its continuity: although the product names, owners, and licenses have changed repeatedly — Star Division, Sun, Oracle, Apache, The Document Foundation — the macro language has remained recognizably the same across all of them. A macro written for StarOffice Basic in the early 2000s is, in most cases, still runnable in a current LibreOffice release.

Current Relevance

StarBasic is very much alive under its modern names. LibreOffice Basic ships in every LibreOffice release — including LibreOffice 26.2 (February 2026) — and is the default, most approachable way to automate the suite, complemented by scripting in Python, JavaScript, and Java via the same UNO API. Apache OpenOffice continues the language as OpenOffice Basic. Between them, a vast body of community tutorials, forum answers, and macro libraries built up over two decades remains relevant and usable.

For most everyday office automation — batch-editing documents, transforming spreadsheet data, generating reports, wiring up custom dialogs — the StarBasic family remains the path of least resistance inside these suites.

Why It Matters

StarBasic occupies an interesting niche in programming history. It is a reminder that BASIC never really went away: alongside Microsoft’s VBA, it kept the accessible, record-and-edit style of office scripting alive for the free-software world. Its lineage — from a teenager’s 1985 word processor, through a German software house, an American hardware giant, and finally a community foundation — mirrors the whole arc of the open-source office-suite movement. And by exposing the entire office suite through the UNO component model, StarBasic showed how a simple, friendly language could sit on top of a serious, language-neutral API — letting beginners take their first automation steps while giving that same object model to more powerful bindings underneath.

Timeline

1985
Marco Börries writes StarWriter 1.0, a word processor for the Zilog Z80 — the seed of what would become the StarOffice suite that hosts StarBasic
1985
Star Division is founded in Lüneburg, Germany by Marco Börries; StarWriter is later ported to CP/M and to DOS
1994
StarOffice 2.0 adds spreadsheet (StarCalc) and database (StarBase) components for Windows, moving toward an integrated suite that a shared macro language could automate
1995
StarOffice 3.0 ships as a cross-platform integrated office suite (MS-DOS, Windows, OS/2, Solaris), broadening the application surface StarBasic would eventually script
1999
Sun Microsystems acquires Star Division (on 5 August 1999) for approximately US$59.5 million, bringing StarOffice and its StarBasic macro language into Sun
2000
Sun releases the StarOffice source code as the open-source OpenOffice.org project; StarOffice Basic becomes known as OpenOffice Basic (OOoBasic) in the community edition
2002
StarOffice 6.0 (built on OpenOffice.org 1.0) is released, accompanied by Sun's formal StarOffice Basic Programmer's Guide documenting the language and its UNO scripting model
2010
The Document Foundation forks OpenOffice.org into LibreOffice; its bundled interpreter implements LibreOffice Basic, a direct continuation of StarBasic
2011
Oracle discontinues Oracle Open Office (the former StarOffice) and donates OpenOffice.org to the Apache Software Foundation, which continues Apache OpenOffice Basic
2026
LibreOffice 26.2 is released (4 February 2026) with the StarBasic-descended LibreOffice Basic still built in and actively maintained by The Document Foundation

Notable Uses & Legacy

StarOffice / Oracle Open Office automation

Throughout the StarOffice product line, StarBasic was the built-in language for recording and writing macros, building custom dialogs, and automating documents across Writer, Calc, Impress, and Base

LibreOffice Basic

LibreOffice ships a direct descendant of StarBasic as LibreOffice Basic — used by individuals, enterprises, and public-sector deployments to script Writer/Calc/Impress/Base and drive the office suite through the UNO API

Apache OpenOffice Basic

Apache OpenOffice continues the same macro language as OpenOffice Basic, so the large body of community StarBasic macros and tutorials remains runnable in a maintained, open-source suite

Office document automation and reporting

Organizations use StarBasic-family macros to automate repetitive editing, generate templated documents and reports, transform spreadsheet data, and integrate the office suite into internal workflows without leaving the application

Migration from Microsoft Office / VBA

Because StarBasic resembles Visual Basic for Applications at the language level, it has served as a landing point for teams porting Excel/Word macro logic when moving from Microsoft Office to OpenOffice.org or LibreOffice

Language Influence

Influenced By

BASIC Visual Basic Visual Basic for Applications

Influenced

OpenOffice Basic LibreOffice Basic

Running Today

Run examples using the official Docker image:

docker pull
Last updated: