From the posts in this website I see how to open an Excel spreadsheet from VB 5.0 but I don't see any examples of moving data (not an array) from vb to excel.
Can anyone show me an example?
Do you know of any books that would have this information?
Thanks

Hi,
Check this code:

Dim xlsheet As Excel.Worksheet
 
TO READ FROM EXCEL
   Text1.Text = xlsheet.Cells(2, 1) 
   Text2.Text = xlsheet.Cells(2, 2) 
   '
TO WRITE INTO EXCEL
   '
   xlsheet.Cells(2, 1) = Text1.Text
   xlsheet.Cells(2, 2) = Text2.Text

Regards
Veena

Thanks. I'm using vb 5.0 so I don't know if I could use that method. I tries Veena's tip and got it to work. Thanks

Thanks, Veena. That did the trick. Could you tell me how i can concatenate 2 vb fields into 1 excel cell?
Thanks

Hi,

u can concatenate 2 fields using "&" this way :

xlsheet.Cells(1, 1) = Text1.Text & ";" & Text2.Text
You can or Cannot use any De-Limiter in Between.
 
Or (No De-Limiter)
 
xlsheet.Cells(1, 1) = Text1.Text & Text2.Text

I Hope it is clear. :lol:

Regards
Veena

This question has already been answered. Start a new discussion instead.