Comments (3)
Hi, ruby example is below.
require 'rubygems'
require 'writeexcel'
wb = WriteExcel.new('fooruby.xls')
ws = wb.add_worksheet
formula = ws.store_formula('=VLOOKUP(K1, A1:B10, 2, FALSE)')
# Workaround for VLOOKUP bug in WriteExcel.
formula.map! {|f| f.sub(/_ref2d/, '_ref2dV') }
(0..9).each do |row|
(0..4).each { |col| ws.write(row, col, row * 10 + col) }
ws.write(row, 10, row * 10)
ws.repeat_formula(row, 11, formula, nil, /^K1$/, "K#{row+1}" )
end
wb.close
from writeexcel.
Hi,
I replied sample code both at stackoverflow and at github. please
see.
sample code is below.
require 'rubygems'
require 'writeexcel'
wb = WriteExcel.new('fooruby.xls')
ws = wb.add_worksheet
formula = ws.store_formula('=VLOOKUP(K1, A1:B10, 2, FALSE)')
Workaround for VLOOKUP bug in WriteExcel.
formula.map! {|f| f.sub(/_ref2d/, '_ref2dV') }
(0..9).each do |row|
(0..4).each { |col| ws.write(row, col, row * 10 + col) }
ws.write(row, 10, row * 10)
ws.repeat_formula(row, 11, formula, nil, /^K1$/, "K#{row+1}" )
end
wb.close
cxn03651
On Thu, 2 Jun 2011 05:51:31 -0700
vijaydev [email protected] wrote:
When using writeexcel to create an Excel file with VLOOKUP formulas, MS Excel displays them as "#VALUE" and I've to edit (no changes) the cell and press Enter to see the actual intended value.
On looking around, this issue seems to have been there in the Perl module as well. http://stackoverflow.com/questions/2229844/how-do-i-get-perls-spreadsheetwriteexcel-to-create-formulas-with-vlookup
What is the Ruby workaround for this?
Thanks.
Reply to this email directly or view it on GitHub:
#10
from writeexcel.
Thanks a lot. Helped solve the issue.
from writeexcel.
Related Issues (20)
- Make block format possible for workbook.close
- Is it only support write excel? how about read? HOT 2
- Data may have lost error HOT 1
- Opening a previously created spreadsheet HOT 1
- Gridlines only hide in two first worksheets HOT 2
- Write `=` into a cell HOT 1
- Validation list with more than 255 chars HOT 6
- Excel found unreadable content in 'file.xls'.Do you want to recover the contents of this workbook HOT 3
- using data_validation for list with a value enclosed with " triggers Racc::ParseError
- UTF-8 Arbitrarily converted to UTF-16LE or UTF-16BE
- Racc::ParseError HOT 3
- Amazon s3 image is not writing into cell HOT 2
- ascii_to_16be bug
- incompatible character encodings: UTF-8 and UTF-16BE bug
- Hyperlinks do not work in Google Spreadsheet or Apple Numbers
- Chart does not render Data Lable
- Labelling a sheet HOT 1
- write_xlsx BUGS
- Release a new version with ruby 3.2 support HOT 2
- Please consider adding nkf as a dependency for this project to support Ruby 3.4.0 HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from writeexcel.