Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8953253
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T14:03:35+00:00 2026-06-15T14:03:35+00:00

Thanks for any help in advance :) Context I am using SpreadsheetGear within my

  • 0

Thanks for any help in advance 🙂

Context
I am using SpreadsheetGear within my Windows Application and there are certain cases where a user will want to copy data from an open Excel application and paste the two dimensional grid into the SpreadsheetGear object in my application.

Motivation
I’m attempting to acquire information from the data in the clipboard in preparation for the paste to happen. The numbers of rows and columns of the data coming in needs to be determined before the paste happens so that the SpreadsheetGear control and other controls on the page are “ready” for the data.

Problem 1
How do I acquire such data from the Clipboard? I’m using

System.Windows.Forms.Clipboard.GetData(...)

but I’m not sure whether I should indicate the DataFormat to be CommaSeparatedValue (CSV) or Text. Will one way or the other work best? Is there another DataFormat that I am overlooking that could help me out?

Problem 2
I used this statement in the Immediate Window of Visual Studio 2012:

System.Diagnostics.Debug.WriteLine(Clipboard.GetText())

Interestingly, this returned a portion of the data I selected and copied in Excel. Is there a limit to the amount of data that the clipboard can handle from Excel? Or is there a way for my Windows App to help allocate more space on the clipboard, knowing the user is about the select data from Excel and copy that data to the clipboard?

Please let me know if I can provide more clarification. I’m a little lost and not sure about the scope of this issue. Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T14:03:36+00:00Added an answer on June 15, 2026 at 2:03 pm

    Here is what ended up working for me:

    try
    {
        var data = Clipboard.GetDataObject();
        var stream = (System.IO.Stream)data.GetData(DataFormats.CommaSeparatedValue);
        var enc = new System.Text.UTF8Encoding();
        var reader = new System.IO.StreamReader(stream, enc);
        string data_csv = reader.ReadToEnd();
        string[] data_csv_array = data_csv.Split(new string[] { "\r\n" }, StringSplitOptions.RemoveEmptyEntries);
        ...
    }
    catch (Exception e)
    {
        ErrorHandling.ShowError("There is no data on the Clipboard to paste.");=
    }
    

    The “…” indicates that I do something pretty particular with the data once I have it in array form. What I wanted to do was display the portion of my solution that would help people in general with a similar need.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using c# .net. Thanks in advance for any help. I have searched
Thanks in advance for any help. I am using a highly customised version of
Thanks for any help in advance, I can't wrap my SQL skills around this
Thanks in advance for any help you can provide on this issue! I manage
Still learning WPF....thanks for any help. Is there any way to Refactor this: <ListBox
Sample data: I can flatten out parent-child relationship using this query.... Any help... Thanks
thanks in advance for any help. I've spent today battling this and I think
and thanks in advance for any help. I have been dabbling in this code
I am struggling with java GUI - thanks for any help in advance! I
i have very serious problem if any tech expert can help...thank you in advance..

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.