Hi Ahmed Soltan,
I don't give you the full solution, but rather some hints.
You are adapting VBA code to work in VB.net, which is indeed a good way when trying to extend the Excel VBO functionality.
Excel VBA itself knows that has xlYes a value of 1 (And xlNo a value of 2), BluePrism does not know this. Hence you need to declare and assign xlYes.
In Excel VBA, indeed an array can be done with Array(), in VB.net you just put it between curly brackets.
Hope this helps you in the right direction.
Don't hesitate to write again if still stuck.
--------------------------------------------------------------------------------------------------------
Dim sw As Object = nothing
dim dw As Object = nothing
Dim ss As Object = nothing
dim ds As Object = nothing
Dim excel As Object = nothing
dim sheet As Object = nothing
dim varUsedRange As Object = nothing
Dim FilteredCount as Long = 0dim xlYes as integer = 1
Try
sw = GetWorkbook(Handle, Source_Workbook)
ss = GetWorksheet(Handle, Source_Workbook, Source_Worksheet)
sw.Activate()
ss.Activate()
excel = ss.Application
sheet = excel.ActiveSheet
varUsedRange = sheet.UsedRange().address 'you can give your own Range
If sheet.AutoFilterMode Then
sheet.AutoFilterMode = False 'Turn off filters if already applied
End If
sheet.Range(""A1:C100"").RemoveDuplicates(Columns:={1,2}, Header:=xlYes)
Success = True
Catch e As Exception
Success = False
Message = e.Message
Finally
sw = Nothing
ss = Nothing
dw = Nothing
ds = Nothing
excel = Nothing
sheet = Nothing
varUsedRange = Nothing
End Try