Go Back   Forum Care Forums > Development Reference Area > Visual Basic

Reply
 
LinkBack Thread Tools Display Modes
convert Excell files
Old
  (#1)
Dave Harris
Guest
 
Posts: n/a
Default convert Excell files - 06-04-2007, 08:52 AM

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.

Dave


   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Re: convert Excell files
Old
  (#2)
Ben Hall
Guest
 
Posts: n/a
Default Re: convert Excell files - 06-04-2007, 08:52 AM

On Tue, 25 Nov 2003 23:27:09 GMT, "Dave Harris" <EMAIL REMOVED>
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 ***ume 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
   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On





Contact Us - Forum Care Forums - Archive - Top