vb 5.0 to excel

Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums - DaniWeb Sister Site
Thread Solved

Join Date: Aug 2006
Posts: 29
Reputation: stan yost is an unknown quantity at this point 
Solved Threads: 0
stan yost stan yost is offline Offline
Light Poster

vb 5.0 to excel

 
0
  #1
Dec 25th, 2006
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
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 15,494
Reputation: Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute 
Solved Threads: 1478
Team Colleague
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is offline Offline
Still Learning

Re: vb 5.0 to excel

 
0
  #2
Dec 25th, 2006
You should study this MSDN article. I think it includes some example too.

[edit]Just noticed the link is for VB .NET, not VB 6. This might give you a start. I'm sure there are many examples. [/edit]
Last edited by Ancient Dragon; Dec 25th, 2006 at 7:59 pm.
Don't PM me with questions -- you might get a nasty PM in response. If you have a question then post it in one of the forums.
Reply With Quote Quick reply to this message  
Join Date: Nov 2006
Posts: 848
Reputation: QVeen72 is on a distinguished road 
Solved Threads: 120
QVeen72's Avatar
QVeen72 QVeen72 is offline Offline
Practically a Posting Shark

Re: vb 5.0 to excel

 
0
  #3
Dec 26th, 2006
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
Reply With Quote Quick reply to this message  
Join Date: Aug 2006
Posts: 29
Reputation: stan yost is an unknown quantity at this point 
Solved Threads: 0
stan yost stan yost is offline Offline
Light Poster

Re: vb 5.0 to excel

 
0
  #4
Dec 26th, 2006
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
Reply With Quote Quick reply to this message  
Join Date: Aug 2006
Posts: 29
Reputation: stan yost is an unknown quantity at this point 
Solved Threads: 0
stan yost stan yost is offline Offline
Light Poster

Re: vb 5.0 to excel

 
0
  #5
Dec 26th, 2006
Thanks, Veena. That did the trick. Could you tell me how i can concatenate 2 vb fields into 1 excel cell?
Thanks
Reply With Quote Quick reply to this message  
Join Date: Nov 2006
Posts: 848
Reputation: QVeen72 is on a distinguished road 
Solved Threads: 120
QVeen72's Avatar
QVeen72 QVeen72 is offline Offline
Practically a Posting Shark

Re: vb 5.0 to excel

 
0
  #6
Dec 27th, 2006
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
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Visual Basic 4 / 5 / 6 Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC