TC from Excel

sean

Member
Hi,
Can we do Table conversion from MS Excel ( I mean input file as .XLS ) ?

Thanks
Rams
 
Hi Rams,

I don't know, that you can do it somehow directly. It is possible, there are some way to do it, but it is sure, that you can do it, if you save the Excel into a CSV file. TC supports comma separated text files as input.

I advise to you, repeat your issue on the Developers board on JDEList Forum.
Not all of developers check this Forum too.

I know, not too much help.

Regards,

Zoltán
 
I don't think you can do that in TC. Got this from KG. Include this VB module to your Excel File. This will convert your Excel Data to CSV file.

Sub QuoteCommaExport()

Dim DestFile As String

Dim FileNum As Integer

Dim ColumnCount As Integer

Dim RowCount As Integer

Dim NonBlank As Integer

' Prompt user for destination file name.

DestFile = InputBox("Enter the destination filename" & Chr(10) & "(with complete path):", "Quote-Comma Exporter")

' Obtain next free file handle number.

FileNum = FreeFile()

' Turn error checking off.

On Error Resume Next

' Attempt to open destination file for output.

Open DestFile For Output As #FileNum

' If an error occurs report it and end.

If Err <> 0 Then

MsgBox "Cannot open filename " & DestFile

End

End If ' Turn error checking on.

On Error GoTo 0

' Loop for each row in selection.

For RowCount = 1 To Selection.Rows.Count

' Loop for each column in selection.

For ColumnCount = 1 To Selection.Columns.Count

' Determine cells length

CellLength = Len(Selection.Cells(RowCount, ColumnCount).Text)

' Loop through each character to determine if there is a non-blank value

For SearchString = 1 To CellLength

CharValue = Mid(Selection.Cells(RowCount, ColumnCount).Text, SearchString, 1)

If CharValue <> " " Then

' Set flag to indicate a non-blank character was found

NonBlank = 1

End If

Next SearchString

If NonBlank = 0 Then

Print #FileNum, """" & " " & """";

Else

' Write current cell's text to file with quotation marks.

Print #FileNum, """" & Selection.Cells(RowCount, ColumnCount).Text & """";

' Check if cell is in last column.

End If

NonBlank = 0

If ColumnCount = Selection.Columns.Count Then

' If so, then write a blank line.

Print #FileNum,

Else

' Otherwise, write a comma.

Print #FileNum, ",";

End If

' Start next iteration of ColumnCount loop.

Next ColumnCount

' Start next iteration of RowCount loop.

Next RowCount

' Close destination file.

Close #FileNum

End Sub
 
Back
Top