The code below is a sample code trying to figure out the syntax of
TextToColumns.
Thank you,
Alex
ap...@ctp.com
oleobject ole_object
long ll_counter
//create a local ole object
Ole_object = create oleobject
//connect the ole object to excel
If ole_object.ConnectToNewObject("excel.application") <> 0 Then
Messagebox("OLE Error","Could not connect to Excel")
Return
End If
//Insert a new book into the spreadsheet
ole_object.workbooks.add()
//add 1 sheet
ole_object.Sheets.Add()
ole_object.application.workbooks(1).worksheets(1).Range("A1").value =
"t1;t2;t2"
ole_object.application.workbooks(1).worksheets(1).Range("A1").TextToColumns(
"A1",True,True,False,False,";",False,False,False,False,False)
// Close workbook
ole_object.application.workbooks(1).Close()
//quit excel
ole_object.application.quit()
//disconnect the object
ole_object.disconnectobject()
//free the memory
destroy ole_object