[Solved] VB Excel conversion
Posted: Thu Dec 13, 2018 12:47 am
After converting Excel Vb to Open Office Basic i am receiving syntax errors being completely new to macros can someone please help.I have tried and searched but no luck
i'm too old i think, This piece of code is meant to operate two buttons for a timer, simply start and stop .Have copied converted code.syntax error occurs on "object"
Hope this is not too much to ask,Quite possibly other errors as well in which case might be easier to install Excel
Thanks in advance
Neil
i'm too old i think, This piece of code is meant to operate two buttons for a timer, simply start and stop .Have copied converted code.syntax error occurs on "object"
Code: Select all
Sub StartTiming()
Dim oSheet as Object[n]oSheet = ThisComponent.CurrentController.ThisComponent.CurrentController.ActiveSheet[n]ThisComponent.CurrentController.select(oSheet.getCellDim oSheet as Object[n]oSheet = ThisComponent.CurrentController.ActiveSheet[n]oSheet.getCellRangeByName($1)ByName(("A:A").Find("")))
ThisComponent.getCurrentSelection.Value = Time
Selection.NumberFormat = "hh:mm:ss"
End Sub
Sub EndTiming()
Dim oSheet as Object[n]oSheet = ThisComponent.CurrentController.ThisComponent.CurrentController.ActiveSheet[n]ThisComponent.CurrentController.select(oSheet.getCellDim oSheet as Object[n]oSheet = ThisComponent.CurrentController.ActiveSheet[n]oSheet.getCellRangeByName($1)ByName(("B:B").Find("")))
ThisComponent.getCurrentSelection.Value = Time
Selection.NumberFormat = "hh:mm:ss"
Dim oSheet as Object[n]oSheet = ThisComponent.CurrentController.ThisComponent.CurrentController.ActiveSheet[n]ThisComponent.CurrentController.select(oSheet.getCellDim oSheet as Object[n]oSheet = ThisComponent.CurrentController.ActiveSheet[n]oSheet.getCellRangeByName($1)ByName(("C:C").Find("")))
ThisComponent.getCurrentSelection.Value = Format(Time, "Long Time")
ThisComponent.getCurrentSelection.FormulaR1C1 = "=RC[-1]-RC[-2]"
Selection.NumberFormat = "mm:ss"
End Sub
Thanks in advance
Neil