Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > Writing formulas to excel spreadsheet

Reply
Thread Tools

Writing formulas to excel spreadsheet

 
 
Mike Stephens
Guest
Posts: n/a
 
      05-21-2011
Chad Perrin wrote in post #1000098:
> and frankly, you shouldn't have to explain why you're writing code
> for something like this, unless it's actually relevant to the problem
> you want help solving.


Chad, if you ever want to learn anything,and my experience of you -like
others before me - is you don't, learn this: it is always vital to
understand why you are doing something.

--
Posted via http://www.ruby-forum.com/.

 
Reply With Quote
 
 
 
 
Damjan Rems
Guest
Posts: n/a
 
      05-23-2011
Just my 5 cents. What do you need formulas for. Is your data going to be
changed by hand in the future?

If not, why not calculate it by your program.

by
TheR

--
Posted via http://www.ruby-forum.com/.

 
Reply With Quote
 
 
 
 
Mike Stephens
Guest
Posts: n/a
 
      05-23-2011
Chad Perrin wrote in post #1000266:
> but it is *not* vital to explain to some
> Microsoft obsessed shitbird why you are using Ruby to interact with an
> XLS file rather than doing it "by hand" in Excel.


The trouble with you Chad is you always manage to miss the point.

No-one on this thread has mentioned doing it by hand. The issue was
whether or not to use Windows OLE rather than a Linux environment, given
that the end-product is for Windows users, and that it is does what Will
wants - unlike his Linux solution.

I'm not Microsoft obsessed. The simple fact is it is the Linga Franca of
the computing world. Linux is only on a tiny minority of desktops. So
it's natural to question why someone would choose to go down a such a
route when Windows is what most other people would be using.

Will has said his colleagues just happen to be avid Linux fans so that's
fair enough.
That answers the question.

I know on this channel I will get the anti-Microsoft lobby. Fortunately
I don't get it at work. Professional programmers grudgingly accept that
NET has bugs and the usual MS baggage but probably is a better bet than
say Java for mainstream e-business. Sadly people rarely have an opinion
on Ruby.

--
Posted via http://www.ruby-forum.com/.

 
Reply With Quote
 
Michal Suchanek
Guest
Posts: n/a
 
      05-23-2011
On 23 May 2011 23:38, Mike Stephens <> wrote:
> Chad Perrin wrote in post #1000266:
>> but it is *not* vital to explain to some
>> Microsoft obsessed shitbird why you are using Ruby to interact with an
>> XLS file rather than doing it "by hand" in Excel.

>
> The trouble with you Chad is you always manage to miss the point.


You too.

>
> No-one on this thread has mentioned doing it by hand. The issue was
> whether or not to use Windows OLE rather than a Linux environment, given
> that the end-product is for Windows users, and that it is does what Will
> wants =C2=A0- unlike his Linux solution.


Not necessarily, the spreadsheets can be used on a variety of systems
all of which can read them.
Now I would choose a different file format but if part of the target
users want to open the files in Excel or another spreadsheet this
might be the most suitable format for the purpose.
CSV or HTML works too but importing into a spreadsheet is somewhat problema=
tic.

>
> I'm not Microsoft obsessed. The simple fact is it is the Linga Franca of
> the computing world. Linux is only on a tiny minority of desktops. So


Maybe where you work. I would guesstimate Windows being on about half
of computers in the world.
That's something that should be taken into consideration but not taken
for granted.

> it's natural to question why someone would choose to go down a such a
> route when Windows is what most other people would be using.
>
> Will has said his colleagues just happen to be avid Linux fans so that's
> fair enough.
> That answers the question.


I did not see anything about them being avid Linux fans. If you did
not notice there are things like Windows without MS Office installed,
OS X, even PDAs and tablets that can run Ruby but not MS Office OLE.

>
> I know on this channel I will get the anti-Microsoft lobby. Fortunately
> I don't get it at work. Professional programmers grudgingly accept that
> .NET has bugs and the usual MS baggage but probably is a better bet than
> say Java for mainstream e-business. Sadly people rarely have an opinion
> on Ruby.


I don't know what you mean by e-business. If you mean serving web
pages then I would rather rely on Java then .NET for the purpose.

Regards

Michal

 
Reply With Quote
 
Christopher Dicely
Guest
Posts: n/a
 
      05-24-2011
On Mon, May 23, 2011 at 2:38 PM, Mike Stephens <> wrote:

>
> I know on this channel I will get the anti-Microsoft lobby. Fortunately
> I don't get it at work. Professional programmers grudgingly accept that
> .NET has bugs and the usual MS baggage but probably is a better bet than
> say Java for mainstream e-business.


Well, except that plenty of professional programmers come to the exact
opposite conclusion wrt the relative desirability of .NET and Java for
mainstream e-business.

 
Reply With Quote
 
Will James
Guest
Posts: n/a
 
      05-24-2011
Damjan Rems wrote in post #1000470:
> Just my 5 cents. What do you need formulas for. Is your data going to be
> changed by hand in the future?
>
> If not, why not calculate it by your program.
>
> by
> TheR


I thought about doing it this way, but the spreadsheet will have
calculations based on previous calculations, based on previous
calculations, and so on, so it's good to have the formulas in there, in
part so that whoever is viewing the formulas can follow the process of
how something is derived (without too much effort), and so that the
viewer can verify that nothing went wrong anywhere in the process of
deriving the final values. Basically, the formulas are good for
transparency, in this case.

--
Posted via http://www.ruby-forum.com/.

 
Reply With Quote
 
Mike Stephens
Guest
Posts: n/a
 
      05-24-2011
Michal Suchanek wrote in post #1000501:
> I would guesstimate Windows being on about half
> of computers in the world.
> even PDAs and tablets that can run Ruby but not MS Office OLE.


According to this
http://marketshare.hitslink.com/oper....aspx?qprid=10

90% of computers run Windows, so normally you'd stand a fair chance of
your program working if you used OLE.

> I don't know what you mean by e-business. If you mean serving web
> pages then I would rather rely on Java then .NET for the purpose.


I'm not saying I'm right or that MS is better. I'm just saying there are
a lot of people in my world (eg web apps for customers to service
120,000 loans; websites to sell international health insurance etc) and
they just don't have this slightly puerile anti-microsoft attitude, so
I'm confused why a few people on here cannot help themselves from making
snide remarks whenever MS is mentioned.

--
Posted via http://www.ruby-forum.com/.

 
Reply With Quote
 
Johnny Morrice
Guest
Posts: n/a
 
      05-24-2011
> I'm not saying I'm right or that MS is better. I'm just saying there
> are a lot of people in my world (eg web apps for customers to service
> 120,000 loans; websites to sell international health insurance etc)
> and they just don't have this slightly puerile anti-microsoft
> attitude, so I'm confused why a few people on here cannot help
> themselves from making snide remarks whenever MS is mentioned.


Before my unbelieving eyes, you have transformed a discussion on using
ruby into an operating system flame war. Now that's magic!

Do you do parties?

 
Reply With Quote
 
Stu
Guest
Posts: n/a
 
      05-24-2011
x11 is not an operating system. FreeBSD is not even on that list. If
your gonna link analysis and statistic web at least link one that has
been around since before the bubble.

http://news.netcraft.com/archives/20...mber-2010.html

As for referring to your peers as childish within your remark about M$
hate. Seriously if you don't know what the problem is at this point
you really should reevaluate some of this cognitive dissonance so you
wont be spewing bullshit like over 90% computer in the whole world run
x,y,z OS.

On Tue, May 24, 2011 at 12:45 PM, Mike Stephens <> wrote:
> Michal Suchanek wrote in post #1000501:
>> I would guesstimate Windows being on about half
>> of computers in the world.
>> even PDAs and tablets that can run Ruby but not MS Office OLE.

>
> According to this
> http://marketshare.hitslink.com/oper....aspx?qprid=10
>
> 90% of computers run Windows, so normally you'd stand a fair chance of
> your program working if you used OLE.
>
>> I don't know what you mean by e-business. If you mean serving web
>> pages then I would rather rely on Java then .NET for the purpose.

>
> I'm not saying I'm right or that MS is better. I'm just saying there are
> a lot of people in my world (eg web apps for customers to service
> 120,000 loans; websites to sell international health insurance etc) and
> they just don't have this slightly puerile anti-microsoft attitude, so
> I'm confused why a few people on here cannot help themselves from making
> snide remarks whenever MS is mentioned.
>
> --
> Posted via http://www.ruby-forum.com/.
>
>


 
Reply With Quote
 
Colin Bartlett
Guest
Posts: n/a
 
      05-25-2011
On Sat, May 21, 2011 at 3:28 AM, Will James <> wrote:
> Daniel Berger wrote in post #999984:
>> On May 20, 3:36pm, Mike Stephens <rub...@recitel.net> wrote:
>>> I'm still fascinated why you are doing sophisticated things with Excel
>>> (not Open Office) but steadfastly refuse to load it on your computer.
>>> Windows and Excel can be purchased for the price of a monitor. You gain
>>> ownership of software that costs hundreds and hundreds of millions to
>>> develop.

>>
>> Even if he had it installed locally, I'm guessing that he would want
>> to generate the document in code since generating it by hand would be
>> cumbersome.

>
> Yep, that's correct - I want the scripts to work across a variety of
> platforms, with as little dependence on outside applications and
> libraries as possible. This is partly because the scripts I'm writing
> may be used by a few others; I don't know about what software they will
> or won't have on their systems, and they will likely not be too willing
> to resolve too many dependency issues. I do have office installed on one
> of my systems, but don't have access to that one right now, and will not
> buy another copy just for this task.


There are other use cases for what you want to do, which is why I'm
interested in any problems you come across and any ways you solve
them. For example: I distrust spreadsheets for making important
calculations (too easy to make errors in obscure cells without
noticing), but they are very useful for displaying data. So I make
some calculations using Ruby (or whatever), and then display the
results on a worksheet page, using formulas to generate some of the
displayed results for the same reasons you give in a later post "it's
good to have the formulas in there, in part so that whoever is viewing
the formulas can follow the process of
how something is derived (without too much effort)". An important part
of what I'm doing is that the worksheets will be usable in even quite
old versions of Excel, so I only want to use elementary features of
Excel.

Actually, the original version of this used Microsoft Excel
VisualBasic for Applications, with all the calculations being done in
VBA, and using VBA to generate the worksheet pages. But I'd rather use
Ruby for the calculations, so I'm currently rewriting it, hence my
interest in what you're doing.

I'm assuming you've looked at things like this
http://www.cpearson.com/excel/optimize.htm
which has a section on using VBA to force calculations: I haven't
tried adapting the VBA code to run from Ruby accessing Excel, but it
should be possible?

As a very orthogonal suggestion: one thing that was worrying me about
my approach was what if I couldn't manage to get Ruby to write
anything directly into Excel. (You haven't got that problem.) But a
possible solution occurred to me: use Ruby (or whatever) to generate a
text file which has a list of cells and values or formulas (and
formatting) to be entered into (or used by) each cell. Then write a
VBA function to read such text files and generate the worksheet(s): a
little messy, but fairly easy to do, and I was much happier once I had
a backup plan if directly accessing Excel through Ruby didn't work.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Writing formulas to excel spreadsheet ampclj9@hotmail.com James Ruby 0 05-19-2011 04:16 PM
[ANN] LXL (Like Excel) 0.1.0 - A mini-language that mimics Microsoft Excel formulas. Kevin Howe Ruby 6 02-06-2005 10:05 PM
Save excel including embedded Formulas, Comments etc. qazmlp Perl Misc 2 11-17-2004 05:46 PM
Re: Writing mathematical formulas without using Word Equation Editor =?iso-8859-1?Q?Andr=E9_P=F6nitz?= Computer Support 0 06-27-2003 08:30 AM
Re: Writing mathematical formulas without using Word Equation Editor =?iso-8859-1?Q?Andr=E9_P=F6nitz?= Computer Support 0 06-27-2003 08:26 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57