Sorry my bad. There quite a bit of code to get to this point but I'm using win 7 64bit, latest wKix 4.62 and call Excel 2010 in kix via

 Code:
$oXL = CreateObject("EXCEL.application")


While I can't include the actual data any single column of data with at least two duplicates can suffice as a test bed.

This bit of code I use to create in Excel, the Sheet BACKEND after CENSUS,

 Code:
xlAddSheet($oXL, '+BACKEND', 'CENSUS', 33)
$LINEOUTPUTFC = "Path","Size","Free"
$oXL.Range("A1:C1").Value = $LINEOUTPUTFC
$oXL.Cells(2,1).Select
$oXL.ActiveWindow.FreezePanes = True
$oXL.Range("A1:C1").Font.Bold = 1
$rc = $oXL.Range("A1:C1").AutoFilter
$oXL.Range("A1:C1").Interior.Colorindex = 15
$oXL.Range("A1:C1").ColumnWidth = 42


the following is where I get the data from 4 separate files and combine them into one Excel sheet BACKEND
and add some formulas:

 Code:
:STARTOFVIPACEXPORT

$rc= $oxL.WorkSheets("BACKEND").Activate

$ARFILES = 1,2,3,4
For Each $ARF IN $ARFILES
  Open (7,"J:\xxxxxxxx\_-SCRIPTS-_\arx0" + $ARF + "@@xx.com - arx_exports_info.csv") 
  $VEDETAILS = ReadLine (7) ;DUMMY HEADER READ
  $VEDETAILS = ReadLine (7) ;1ST ACTUAL DATA LINE
  $VEDETAILS = Replace($VEDETAILS,'"',"")
  
  While @ERROR = 0
  	$VEARRAYS = Split($VEDETAILS,",")
  	$VEPATH = $VEARRAYS[1] + $VEARRAYS[3]
  	$VEPATH = Replace($VEPATH,"/","\")
  	$VELOOKUP = '=IfERROR(VLOOKUP($$B$EXCELROW8,BACKEND!$$A:$$B,2,FALSE),"")'
  	$ARRAYS = $VEARRAYS[2],$VEPATH,$VELOOKUP
  	$oXL.Range("A$EXCELROW8:C$EXCELROW8").Value = $ARRAYS
  	$EXCELROW8 = $EXCELROW8 + 1
  	$VEDETAILS = ReadLine (7)
  	$VEDETAILS = Replace($VEDETAILS,'"',"")
  Loop
	
	Close (7)
Next

$oXL.Range("A1:C1").EntireColumn.AutoFit 	


All this works fine. However as time goes on we are getting many duplicates from the exports, their nature, and since I use the exports as VLOOKUP references I want to trim out the dups to speed up the searches.

This is where I tried importing the VB command REMOVEDUPLICATES.

And so here I am. Again the test data can be a small excel sheet with 3 or 4, 5 items with at least one repeating:

APPLE
PEAR
FRUIT
TWO
PEAR


It's the porting of the REMOVEDUPLICATES method from VB basic to Kix I can't get right.

Please let me know if you need more info.
Thanks


Edited by 99osou (2012-08-30 08:09 PM)