Macro VBA excel to calc

 Sub vallerH24()
'
' valler Macro
'
' Keyboard Shortcut: Ctrl+Shift+I
     Range("C5").Select
     Selection.Copy
     lMaxRows = Cells(Rows.Count, "G").End(xlUp).Row
    Range("G" & lMaxRows + 1).Select
     Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False
Application.OnTime Now + TimeValue("00:02:00"), "vallerH24"
End Sub
Sub ripeti()
Application.OnTime Now + TimeValue("00:02:00"), "vallerH24"
End Sub

Hello, unfortunately I come from excell microsoft. I have decided not to use it anymore because it is really too heavy.
I had created a working macro where I copied a value under a busy column. And gradually more and more below.
all this had to happen at a certain time.

I was convinced that the language between the two programs was compatible. instead no.

this is my macro.
Anyone can help me??
Thank you

Use APSO to enter this Python code.

from threading import Timer

def append_to_column():
    oSheet = XSCRIPTCONTEXT.getDocument().getSheets().getByIndex(0)
    oColumns = oSheet.getColumns()
    COLUMN_G = ord('G') - ord('A')
    oColumn = oColumns.getByIndex(COLUMN_G)
    oFinder = oColumn.createSearchDescriptor()
    oFinder.SearchRegularExpression = True
    oFinder.SearchString = "."  # match cells that have something in them
    oResult = oColumn.findAll(oFinder)
    if oResult:
        sRange = oResult.AbsoluteName
        last_filled_row = int(sRange.rsplit("$", 1)[1])
    else:
        last_filled_row = 0
    new_row = str(last_filled_row + 1)
    cell_to = oSheet.getCellRangeByName("G" + new_row)
    cell_from = oSheet.getCellRangeByName("C5")
    cell_to.setString(cell_from.getString())
    t = Timer(120.0, append_to_column)
    t.start()

g_exportedScripts = append_to_column,

References:

maybe time to update this python-code after 6 years:

from threading import Timer

def append_to_column():
    sheet = XSCRIPTCONTEXT.getDocument().Sheets[0]
    column_g = sheet.Columns.G
    source = sheet['C5'].String
    switch = sheet['C4'].Value
    # delete C4 to stop repeating Timer after next t.start()
    first_empty = column_g.queryEmptyCells()[0][0,0]
    first_empty.String = source
    if switch:
        t = Timer(120 , append_to_column)
        t.start()
1 Like

… and answer the starting question.

The Application.OnTime method can be used as follows (from Calc document macros only).
Place the following macro in Module1 of the Standard library of the Calc document and run the macro.

Option VbaSupport 1
Sub TestAppRun
  Print "AppRun: " & Now()  
  Application.OnTime Now + TimeValue("00:00:05"), "Standard.Module1.TestAppRun" 
End Sub