lotusscript

Trying to automate Excel and having issues with VBA Code trying to get to lotusscript


Example:

xlApp.ActiveWorkbook.ActiveSheet.Range("A2:A" + lastrow).AdvancedFilter Action:= xlFilterCopy, CopyToRange:= xlApp.ActiveWorkbook.ActiveSheet.("K1"), Unique:=True

The issue is the := part of the VBA Code. I do not know how to get that in Lotusscript to work?

Any help is much appreciated.

Thanks to all


Solution

  • Wrap the method arguments in parentheses like the example below. Optional arguments can be omitted by not specifying them.

    See Microsoft's website for details

        Dim xlApp As Variant, lastrow As String
        Const xlFilterCopy = 2
        
        lastrow = "3"
        Set xlApp = CreateObject("Excel.Application")
        xlApp.Visible = True
        xlApp.WorkBooks.add
        xlApp.ActiveWorkbook.ActiveSheet.Range("A2").Value="One"
        xlApp.ActiveWorkbook.ActiveSheet.Range("A3").Value="Two"
        
        Call xlApp.ActiveWorkbook.ActiveSheet.Range("A2:A"+lastrow).AdvancedFilter(xlFilterCopy, ,xlApp.ActiveWorkbook.ActiveSheet.Range("K1"), True)