Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
1
Question by centaurianmudpig · Apr 06, 2016 at 03:57 PM · errorbuildreadexcel

Reading an excel file using ExcelReaderFacotry

Hi guys,

I'm probably just shouting in the wind here given I am using a 3rd party library (See: https://github.com/ExcelDataReader/ExcelDataReader). I started using this library as the mono implementation of reading excel file is broken for the 64bit version.

I have the ExcelDataReader functionality working in the Unity editor. I read an Excel file and store the data in memory. No problem.

I then build my game. I put the excel file into the _Data location. I run the game and now the Excel file is not being read.

Debugging using LogError shows the FileStream has been opened. There is no problem in opening the Excel file. It is in the correct location.

The problem is when I use the stream to CreateOpenXmlReader(). The excelReader.IsClosed is equal to True.

I don't understand why this is the case. The DLL's for the library are in the Managed Folder the Excel files are in the correct location.

Basically I'm asking anyone who has used ExcelDataReader and created a project build, is it solvable and how so? Thanks.

     protected void OpenDataReader(string _filename) {
         DataSet result;
 
         _filename = string.Concat(Application.dataPath, "/Data/", _filename, ".xlsx");
         FileStream stream = File.Open(_filename, FileMode.Open, FileAccess.Read);
         **excelReader = ExcelReaderFactory.CreateOpenXmlReader(stream);**  //IsClosed = True
 
         result = excelReader.AsDataSet();
         skipFirstRow = true;
     }
 
Comment
Add comment · Show 3
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image IvanRibakov · Jun 19, 2018 at 01:28 PM 0
Share

Were you able to get anywhere with this problem?

avatar image centaurianmudpig · Jun 19, 2018 at 04:59 PM 0
Share

I had to abandon that implementation and use a 3rd party CSV Reader. http://wiki.unity3d.com/index.php/CSVReader

avatar image IvanRibakov · Jun 19, 2018 at 06:34 PM 0
Share

I see. I was able to resolve the issue by upgrading the ExcelDataReader to the latest version (from 2.1.2.3 to 3.4.0). Unfortunately couldn't trace the problem to a specific issue/commit within the project.

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by MyUnitydream · Sep 12, 2018 at 05:12 AM

you can use Uni-Excel Package for Read, Write, and edit excel files

https://assetstore.unity.com/packages/tools/uni-excel-47540

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

52 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Distribute terrain in zones 3 Answers

Error - failed to re-package resources (Android) 1 Answer

Failed to re-package resources (Android build) 0 Answers

Unity crash on build to iOS 2 Answers

Cloud Build Can't connect to Mercurial Repo ( Repo is not accessible. ) 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges