can not run excel macro-enabled file in LibreOffice spreadsheet

I created a macro-enabled workbook in Excel and tried it on LibreOffice spreadsheet and it wouldn’t run…
is there anything I have to do or modify to make it run under LibreOffice spreadsheet?
thank you…

Please be more specific and provide details. What do you mean by wouldn’t run? Is this LO security warning regarding Macros? Or you get an error message while executing the code? Normally, Excel VBA and OOo Basic codes are not compatible - quoting A. Pitonyak “The OOo macro language is similar to the one in Microsoft Office because they are both based on BASIC. Both macro languages access the underlying implementation structures, which differ significantly and are therefore incompatible.”

sorry for the vague statement. I try to attach the macro-enabled file but it is not allowed. so I am showing the sub below that is not functioning and no error message is displaying.
ALSO kindly see the image - the sorting module prompted an error.
is there a need to modify the codes?
these are not happening in Excel.
many thanks…

Sub Delete_Duplicates_in_NewSheet()
Application.ScreenUpdating = False
On Error Resume Next
If (Worksheets(“NewSheet”).Name = “”) Then
MsgBox “[NewSheet] not found!”, vbCritical
Range(“A2”).Select
Exit Sub
End If
Sheets(“NewSheet”).Select
lastrow = Cells(Rows.Count, “A”).End(xlUp).Row
Set CS = Sheets(“NewSheet”)
CS.Range(“A1:P” & lastrow).RemoveDuplicates _
Columns:=Array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16), Header:=xlYes
Application.ScreenUpdating = True
Application.DisplayAlerts = True
On Error GoTo 0
Range(“A2”).Select
End Sub

sorterror.jpg

Some remarks:

  1. Please edit your question or use a comment section if any clarification is needed - see Guidelines for asking. Do not use an answer box for this purpose.
  2. As stated ealier, MS Excel and LibreOffice/OpenOffice use different methods and properties so you need to adapt code for another party’s software. This is definitely your case.
  3. I have upvoted your question - you should be able to upload file now.

So please edit your question, add your file for inspection and it would be nice to explain expected Macro behavior - what the macro should do and what is the expected result. As Excel and LO differs, I can not be sure that I read and understand the VBA code correctly.