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 7015275
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T22:37:50+00:00 2026-05-27T22:37:50+00:00

I have data in an Excel spreadsheet with values like this: 0.69491375 0.31220394 The

  • 0

I have data in an Excel spreadsheet with values like this:

  • 0.69491375
  • 0.31220394

The cells are formatted as Percentage, and set to display two decimal places. So they appear in Excel as:

  • 69.49%
  • 31.22%

I have a C# program that parses this data off the Clipboard.

var dataObj = Clipboard.GetDataObject();
var format = DataFormats.CommaSeparatedValue;

if (dataObj != null && dataObj.GetDataPresent(format))
{
    var csvData = dataObj.GetData(format);
    // do something
}

The problem is that csvData contains the display values from Excel, i.e. ‘69.49%’ and ‘31.22%’. It does not contain the full precision of the extra decimal places.

I have tried using the various different DataFormats values, but the data only ever contains the display value from Excel, e.g.:

  • DataFormats.Dif
  • DataFormats.Rtf
  • DataFormats.UnicodeText
  • etc.

As a test, I installed LibreOffice Calc and copy/pasted the same cells from Excel into Calc. Calc retains the full precision of the raw data.

So clearly Excel puts this data somewhere that other programs can access. How can I access it from my C# application?

Edit – Next steps.

I’ve downloaded the LibreOffice Calc source code and will have a poke around to see if I can find out how they get the full context of the copied data from Excel.

I also did a GetFormats() call on the data object returned from the clipboard and got a list of 24 different data formats, some of which are not in the DataFormats enum. These include formats like Biff12, Biff8, Biff5, Format129 among other formats that are unfamiliar to me, so I’ll investigate these and respond if I make any discoveries…

  • 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-05-27T22:37:51+00:00Added an answer on May 27, 2026 at 10:37 pm

    Also not a complete answer either, but some further insights into the problem:

    When you copy a single Excel cell then what will end up in the clipboard is a complete Excel workbook which contains a single spreadsheet which in turn contains a single cell:

    var dataObject = Clipboard.GetDataObject();
    var mstream = (MemoryStream)dataObject.GetData("XML Spreadsheet");
    
    // Note: For some reason we need to ignore the last byte otherwise
    // an exception will occur...
    mstream.SetLength(mstream.Length - 1);
    
    var xml = XElement.Load(mstream);
    

    Now, when you dump the content of the XElement to the console you can see that you indeed get a complete Excel Workbook. Also the “XML Spreadsheet” format contains the internal representation of the numbers stored in the cell. So I guess you could use Linq-To-Xml or similar to fetch the data you need:

    XNamespace ssNs = "urn:schemas-microsoft-com:office:spreadsheet";
    
    var numbers = xml.Descendants(ssNs + "Data").
                  Where(e => (string)e.Attribute(ssNs + "Type") == "Number").
                  Select(e => (double)e);
    

    I’ve also tried to read the Biff formats using the Excel Data Reader however the resulting DataSets always came out empty…

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

Sidebar

Related Questions

I have some data structured like this in an Excel spreadsheet: A B C
Ok, so I have an excel spreadsheet that contains data that I would like
I have a large data set that I'm working with in excel. About 1000+
I have an excel spreadsheet with the following data ----- A-----------------B 1 ----X 2
I have data in an Excel spreadsheet that has 10,000 rows with the following
I have a script that pulls data out of an excel spreadsheet using the
Suppose i have the following raw data in excel spreadsheet: [Name ] [ID ]
I have the following data in an Excel Spreadsheet: A B C 1 b
I have data in Excel files that I am pulling out using the MS
I have following data in excel table r1 r2 r3 r4 r5 v1 v2

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.