Solved

Create Delimited String that will paste into excel

Posted on 2008-06-16
5
905 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
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 85

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: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

Title # Comments Views Activity
Open dialog with server side controls in it 3 46
Where does legacy ASP.NET initialize language? 2 56
TFS 2015 Access denied. 1 30
vb.net deleting excel sheet in workbook 11 30
It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
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…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

763 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