I have the following macro in a Calc file:
Dim oDoc as Object oDoc=ThisComponent Dim oSheets as Object oSheets = oDoc.Sheets Dim oController as Object oController