On Tue, 25 Nov 2003 23:27:09 GMT, "Dave Harris" <dh******@woh.rr.com>
wrote:
Is there any way to have VB6 programmatically convert an embedded Excell
file into a text file (or any sequential file)? I am relatively new to VB6
and none of the books I have consulted have the solution. Thanks in advance.
When you say embedded I assume you mean you are using an OLE container
control. The following code opens a sequential file, writes out the
contents of a known Excel range and closes the file.
dim objExcel as Object
set objExcel = oleExcel.Object
dim row as integer
dim col as integer
open "csv.txt" for output as #1
for row = 1 to 10
for col = 1 to 10
print #1, objExcel.worksheets("sheet1").Cells(row, col).Value
next col
next row
close #1