944,153 Members | Top Members by Rank

Ad:
Dec 25th, 2006
0

vb 5.0 to excel

Expand Post »
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
Similar Threads
Reputation Points: 10
Solved Threads: 0
Light Poster
stan yost is offline Offline
29 posts
since Aug 2006
Dec 25th, 2006
0

Re: vb 5.0 to excel

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.
Sponsor
Team Colleague
Featured Poster
Reputation Points: 5608
Solved Threads: 2283
Retired and Enjoying Life
Ancient Dragon is offline Offline
21,963 posts
since Aug 2005
Dec 26th, 2006
0

Re: vb 5.0 to excel

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
Reputation Points: 84
Solved Threads: 140
Posting Shark
QVeen72 is offline Offline
923 posts
since Nov 2006
Dec 26th, 2006
0

Re: vb 5.0 to excel

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
Reputation Points: 10
Solved Threads: 0
Light Poster
stan yost is offline Offline
29 posts
since Aug 2006
Dec 26th, 2006
0

Re: vb 5.0 to excel

Thanks, Veena. That did the trick. Could you tell me how i can concatenate 2 vb fields into 1 excel cell?
Thanks
Reputation Points: 10
Solved Threads: 0
Light Poster
stan yost is offline Offline
29 posts
since Aug 2006
Dec 27th, 2006
0

Re: vb 5.0 to excel

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
Reputation Points: 84
Solved Threads: 140
Posting Shark
QVeen72 is offline Offline
923 posts
since Nov 2006

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Visual Basic 4 / 5 / 6 Forum Timeline: Help on making and using Database in VB
Next Thread in Visual Basic 4 / 5 / 6 Forum Timeline: license code





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC