Crash macro trying to access using libreOffice

I have an excel file that we use to search items and return data in excel sheet related to the item you searched. Right now if I use excel on new PC it works fine but if I use LibreOffice, it gives me errors as you can see below. Also if I use old windows 10 PC and Libreoffice, it works fine. I am not sure what is the issue here. Please help in troubleshooting.

I am not a programmer so go easy on me.

I am using windows 10 pro and Libreoffice 7.5.3

Below is the macro:

Rem Attribute VBA_ModuleType=VBAModule
Option VBASupport 1
Sub wave_reset()

    Dim iRow As Long, sh As Worksheet, LastRows As Range
    Set sh = ActiveWorkbook.Sheets("Wave Fixtures")
    iRow = sh.Cells(sh.Rows.Count, "C").End(xlUp).Row + 1
    
    With WaveForm
        ' TODO: Replace fields with correct fields for default values
        .txtComment.Value = ""
        .txtCust.Value = ""
        .txtRequestor.Value = ""
        .ordNum.Value = ""
        .dateOrdered.Value = ""
        .dateReceived.Value = ""
        .optNew.Value = False
        .optreorder.Value = False
        .optUpdate.Value = False
        .QuantNum.Value = ""
        .assyNum.Value = ""
        .fabNum.Value = ""
        .fabRev.Value = ""
        .Loc.Value = ""
        .poNum.Value = ""
        .costNum.Value = ""
        .invNum.Value = ""
        
        ' TODO: Add vendors in 'Vendors' sheet to populate drop-down
        With .cmbVend
            .Clear
            .List = Sheets("Vendors").Range("A:A").Value
            .ListIndex = 0
        End With
        
        
        ' Show results in form page
        .lstDbase.ColumnCount = 15
        .lstDbase.ColumnHeads = False
        .lstDbase.ColumnWidths = "15,50,50,50,50,50,50,50,50,50,50,50,50,50,50"
        If iRow > 1 Then
            '.lstDbase.RowSource = "Wave Fixtures!B1:R" & iRow
            .lstDbase.RowSource = "'Wave Fixtures'!A" & iRow - 5 & ":R" & iRow
        Else
            .lstDbase.RowSource = "'Wave Fixtures'!B2:R2"
        End If
    End With
```  End Sub



Sub DebugLog(sFile As String, sText As String)
    Dim FileNumber As Integer
    FileNumber = FreeFile                   ' Get unused file number
    Open sFile For Append As #FileNumber    ' Connect to the file
    Print #FileNumber, sText                ' Append our string
    Close #FileNumber                       ' Close the file
End Sub



 Sub wave_submit()

    Dim sh As Worksheet
    Dim iRow As Long
    Set sh = ActiveWorkbook.Sheets("Wave Fixtures")  ' Fetch currently open workbook and use 'database' sheet
    iRow = sh.Cells(sh.Rows.Count, "C").End(xlUp).Row + 1  ' Fetch last row in sheet (Should change to a column that is ALWAYS populated, such as P/N)
    
    With sh
       
        ' TODO: Replace lines below with correct data mapping
        ' Just change the 2nd number in each `Cells(iRow, X)`
        '   to match the column you want to put it in.
        '   (Column A is 1; which you probably want to skip)
        
        ' Populate sheet with data
        ' .Cells(iRow, 2) = iRow - 1                    cmh removed
        .Cells(iRow, 3) = WaveForm.fabNum.Value
        .Cells(iRow, 4) = WaveForm.ordNum.Value
        .Cells(iRow, 5) = WaveForm.assyNum.Value
        .Cells(iRow, 6) = WaveForm.Loc.Value
        .Cells(iRow, 7) = WaveForm.fabRev.Value         ' cmh added
        
        If WaveForm.optNew.Value = True Then
            .Cells(iRow, 11) = "New"
        ElseIf WaveForm.optreorder.Value = True Then
            .Cells(iRow, 11) = "Re-Order"
        ElseIf WaveForm.optUpdate.Value = True Then
            .Cells(iRow, 11) = "Update"
        Else
            .Cells(iRow, 11) = "UNKNOWN"
            
        .Cells(iRow, 13) = WaveForm.txtCust.Value
        .Cells(iRow, 17) = WaveForm.txtComment.Value
        .Cells(iRow, 8) = WaveForm.txtRequestor.Value
        .Cells(iRow, 9) = WaveForm.dateOrdered.Value     ' cmh updated
        .Cells(iRow, 10) = WaveForm.dateReceived.Value
        .Cells(iRow, 12) = WaveForm.cmbVend.Value
        .Cells(iRow, 14) = WaveForm.poNum.Value
        .Cells(iRow, 15) = WaveForm.costNum.Value
        .Cells(iRow, 18) = WaveForm.invNum.Value
        .Cells(iRow, 16) = WaveForm.QuantNum.Value      ' cmh added
        
    End With
End Sub

    
    
Sub Wave_Show_Form()
    Load WaveForm
    WaveForm.Show
End Sub

I can’t, but to improve chances to get help, you may

  • post your macro, so one can check, what it is really doing. If you enclose it in triple backticks ``` the macro will even be readable.
  • identify the OS and LibreOffice version of the computer wich shows the problems - until now we know its not your “old windows 10 PC”
  • change the tag from base to macro unless your macro uses the database-component of LibreOffice named Base
  • Maybe correct your title. My guess is “crash” and “macro”, instead of “crush” and “micro”

PS: For a programmer “getting errors” is a different thing as a “crash”. An error message at a defined place gives a starting point to search for a reason (, if you actually read the text and check where the error is shown). If a program seems to hang (no response for long time) we have to search for the place first. Same when a program really crashes (process ended, maybe recovery offered)

1 Like