Solved

Create Delimited String that will paste into excel

Posted on 2008-06-16
5
906 Views
Last Modified: 2013-11-07
in vb.net, what I want to do is lets say my string exists as

200, 300, 400, 5000, 6000

I am thinking I have created a comma deliminated string. The next step is to copy it to the clipboard so that the user can go and copy paste these values into notepad or excel.
The problem is if they go into excel it goes and pastes all the values into one cell it appears all in one cell.

Thanks for any help.
0
Comment
Question by:scorpion53061
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 23

Expert Comment

by:Christopher Kile
ID: 21796634
You have created a comma-delimited string, but Excel imports comma-delimited strings from FILES, not from the Paste buffer.

I don't know if Dynamic Data Exchange (DDE) is still supported, but that technology allowed what you are trying to do - however, it was not for the faint of heart.
0
 

Author Comment

by:scorpion53061
ID: 21796686
well I do know if I replace the comma with a tab it will do what I am seeking. There shoudl be a way to do it with the comma.
0
 
LVL 13

Expert Comment

by:joechina
ID: 21796741
When I copy a delimited string to Excel, I get a little hint to let me select Text Import Wizard...
Your string looks fine to me.
0
 
LVL 86

Accepted Solution

by:
Mike Tomlinson earned 500 total points
ID: 21797100
"well I do know if I replace the comma with a tab it will do what I am seeking."

So replace the Commas with Tabs...    =O

        Dim data As String = "200, 300, 400, 5000, 6000"
        Clipboard.SetText(data.Replace(", ", ",").Replace(",", vbTab))

"There shoudl be a way to do it with the comma."

Why "should" it work with a comma?...
0
 
LVL 23

Expert Comment

by:Christopher Kile
ID: 21797697
dunno about the asker, but I've just learned a few things about Excel that I'd completely forgotten...apologies for earlier bad advice and thanks to others for better suggestions....
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

710 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question