Click here to Skip to main content
15,892,697 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All,

I'm trying to import an Excel spreadsheet into a 2 dimensional array but am not sure whether there is a way to hardcode this as I'm not sure how Excel delimits its values.

I've seen it suggested that the Spreadsheet class can be used within:
using DocumentFormat.OpenXML
but I'm not sure what reference I need to add to use this assembly.

Can anyone help with the reference or does anyone have any easier way to store an Excel spreadsheet as a 2D array?

I'm still in the early stages of learning to use C# so any help is very much appreciated. I'm using Visual Studio 2010.

Thanks,
Stephen.
Posted

If in doubt, try google. A quick search for "DocumentFormat.OpenXML" gave me the MSDN DocumentFormat.OpenXml namespace[^] information. Looking at a random property from that: OfficeAvailabilityAttribute class[^] gives you the info:
Assembly:  DocumentFormat.OpenXml (in DocumentFormat.OpenXml.dll)
 
Share this answer
 
Hi Originalgriff,

Thanks very much for this information. I'm just having a problem with locating that reference when I try to add it. Does anyone know if it should be in a particular place or if the .dll file is linked to a particular program? Is this within a particular program I may not yet have downloaded?

Thanks,
Stephen.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900