Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can I close a spreadsheet? #143

Closed
TechRsch opened this issue Aug 2, 2014 · 18 comments
Closed

Can I close a spreadsheet? #143

TechRsch opened this issue Aug 2, 2014 · 18 comments

Comments

@TechRsch
Copy link

TechRsch commented Aug 2, 2014

After processing, I'd like to close the spreadsheet so that I can rename/move/delete it. Is that possible?

@TechRsch
Copy link
Author

TechRsch commented Oct 2, 2014

Not sure how to get attention, but I would ask for help on this. It will help automate what is now a manually intensive process. I'd appreciate the help.

@chase439
Copy link

chase439 commented Feb 4, 2015

I'm having the same issue. I can't delete the file after doing:

file = Rails.root.join("folder1", "file1.xls").to_s
s = Roo::Excel.new(file)
File.delete(file)  # => Errno::EACCES: Permission denied

@stevendaniels
Copy link
Contributor

@chase439 , which version of Roo are you using?

@chase439
Copy link

I'm using version 1.13.2

@stevendaniels
Copy link
Contributor

This issue affects an older version of Roo.

You'll need to add the following to your gemfile to install the most current version.
gem 'roo', git: 'git://github.com/roo-rb/roo.git'

Please let me know if the issue still exists in the current version of Roo.

@chase439
Copy link

The latest code works and allows for file deletion. Could you please make another version of Roo with the latest code on rubygems?

@stevendaniels
Copy link
Contributor

I created an issue for updating Roo on RubyGems

Can we close this issue?

@chase439
Copy link

I'm fine with you closing this issue. Thanks for the help!

@medexdev
Copy link

medexdev commented Mar 3, 2015

I'm still unable to delete it. Here's what I did.
require 'roo-xls'
s = Roo::Excel.new('abc.xls')
s.to_csv('abc.csv')
File.delete('abc.xls')
I got permission error. I tested on both windows and linux. I also tried using just spreadsheet.
s = Roo::Spreadsheet.open('abc.xls')
The rest is the same as above. I still got permission error. please advise. Thanks.

@stevendaniels
Copy link
Contributor

@medexdev It looks like you're using version 1.13.2.
That issue is fixed in 2.0.0.

Roo version > 2 isn't available on RubyGems. It's only available on github. Add the following to your gemfile to install it.

gem 'roo', git: 'git://github.com/roo-rb/roo.git'

@stevendaniels
Copy link
Contributor

This issue is fixed in roo 2.0.0, which is available on Rubygems.

@TechRsch
Copy link
Author

TechRsch commented Jun 1, 2015

Okay, can you tell me how to close a spreadsheet? Nothing I've tried does that. Thanks.

@stevendaniels
Copy link
Contributor

@TechRsch did you notice this problem with xlsx files or with xls files?

Can you create a gist for this issue (sample gist)? Here are some instructions for creating such a gist.

  1. Create a gist with code that creates the error.
  2. Clone the gist repo locally, add a stripped down version of the offending spreadsheet to the gist repo, and push the gist's changes master.
  3. Paste the gist url here.

Thanks.

@TechRsch
Copy link
Author

TechRsch commented Jun 2, 2015

@stevendaniels Okay, I get it. I couldn't figure out how to get it closed and rename kept throwing an error. However, it doesn't need to be closed? And, rename was throwing the error not because it was open but because I had the rename wrong which I missed because I thought it was open. Thanks.

@TechRsch TechRsch closed this as completed Jun 2, 2015
@TechRsch
Copy link
Author

In #221, you mentioned that you would reopen #143 and look into my question. Is what I need possible? Thank you.

@TechRsch TechRsch reopened this Jun 24, 2015
@stevendaniels
Copy link
Contributor

@TechRsch Could you give more details about what you're trying to do? It would be really helpful if you provided a code sample that illustrates what is going wrong.

@stevendaniels
Copy link
Contributor

I'm closing this issue. Without anymore information, I can't properly determine if this issue still exists. If anyone encounters this issue, please submit a gist with the offending code.

@aminzer
Copy link

aminzer commented Dec 22, 2017

I've already opened issue in roo-rb/roo-xls#40 but thought that problem might be related not to roo-xls, but roo.

@stevendaniels, Can you please answer on question in roo-rb/roo-xls#40 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants