By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,064 Members | 1,524 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,064 IT Pros & Developers. It's quick & easy.

Excel ClipBoard to VB.NET

P: n/a
Hi,

Is there an 'exact' way to get data in a VB.NET 2005 application that was
put on the clipboard in Excel?

For instance:

When I have an Excel-sheet with 4 values (2 columns, 2 rows)
A1 B1
A2 B2

I copy it to the clipboard, and get this in my VB.NET application:

?my.Computer.Clipboard.GetText
"t1 t2
t3 t4
"

?my.Computer.Clipboard.GetText.Split(vblf)
{Length=3}
(0): "t1 t2
"
(1): "t3 t4
"
(2): ""

?my.Computer.Clipboard.GetText.Split(vbtab)
{Length=3}
(0): "t1"
(1): "t2
t3"
(2): "t4
"

So basicly: I have to cut them in rows by splitting on vbCr, and than cut
every line in columnc by splitting on vbTab...

Is this the only way? Or does a 'nicer' way exists?

Thanks,

Pieter

Apr 6 '06 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.