Forum: Ruby vba --> ruby: tool, parse or assimilation?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Chiaro S. (Guest)
on 2006-04-11 19:17
(Received via mailing list)
Do you guys know of any tool that can help me onverting a vba classic
code
base to ruby?
I am not talking about GUIs and stuff, just good old plain business
logic.

If I can't find any tool I will go for one of these two solutions:
* vba parsing and ruby generation

OR

* I could do some basic text substitution on the VBA files to make them
well-formed for ruby and then try to run them as ruby code.  Of course I
will write and include libraries that wrap around ruby objects (eg:
Collection will wrap around Array).

I can hardly resist trying the second option :-)  has any of you tried
anything like that before?
James B. (Guest)
on 2006-04-11 20:39
(Received via mailing list)
chiaro scuro wrote:
> Do you guys know of any tool that can help me onverting a vba classic code
> base to ruby?
> I am not talking about GUIs and stuff, just good old plain business logic.

How do you plan on running this converted code?  My understanding of VBA
is that it is a subset of VB that expects to operate inside a
application container (such as Microsoft Word, Excel, etc.)

I once took a look at getting Word to run Ruby in place of VBA; the best
I came up with was using VBA to shell out and call Ruby code.

http://www.jamesbritt.com/articles/RubyAndVbaForWe...

If there is a way to execute Ruby directly, in place of VBA , I'd be
interested in hearing about it.


--
James B.

"The greatest obstacle to discovery is not ignorance, but the illusion
of knowledge."
  - D. Boorstin
Chiaro S. (Guest)
on 2006-04-11 22:21
(Received via mailing list)
On 4/11/06, James B. <removed_email_address@domain.invalid> wrote:
>
> How do you plan on running this converted code?  My understanding of VBA
> is that it is a subset of VB that expects to operate inside a
> application container (such as Microsoft Word, Excel, etc.)


I just need to export the business logic, then I will re-write the GUI
on
top of it.
However, what you could do is to externalize the business logic and to
open
excel just as a GUI.  You could also get a reference to a running excel
instance and hook up some callbacks to it.

I find excel to be a very agile way platform to prototype apps, but
after a
couple of weeks of development it always runs out of options.

If there is a way to execute Ruby directly, in place of VBA , I'd be
> interested in hearing about it.


Me too :-)
I'd love to be able to make a call to a Ruby COM Script Engine!
David V. (Guest)
on 2006-04-12 04:10
(Received via mailing list)
DÅ?a Utorok 11. Apríl 2006 20:18 chiaro scuro napísal:
>
> I find excel to be a very agile way platform to prototype apps, but after a
> couple of weeks of development it always runs out of options.
>

Ye gods. Chiaro, meet Rails. Rails, meet Chiaro. I'm sure you'll be the
best
of friends once you get to know each other ;P An agile platform to
prototype
apps (and then some) that I've yet to come to the end of options of.
</fanboy>

> If there is a way to execute Ruby directly, in place of VBA , I'd be
>
> > interested in hearing about it.
>
> Me too :-)
> I'd love to be able to make a call to a Ruby COM Script Engine!
>

Isn't there ActiveScriptRuby for that? Never actually tried it, just
hearsay.

David V.
Chiaro S. (Guest)
on 2006-04-12 04:58
(Received via mailing list)
On 4/12/06, David V. <removed_email_address@domain.invalid> wrote:
> apps (and then some) that I've yet to come to the end of options of.
> </fanboy>


:-) of course, of course, we all love rails. It depends on what you are
prototyping, though. rails is fantastic for the web app domain. other
domains have different needs.

the good thing about excel is that you can get the user very actively
and
personally involved in designing the application on many levels.  The
degree
of flexibility and reuse however is very low, as you would expect.

if you are prototyping financial apps, using excel+vba can boost your
productivity at least ten times compared to java/ruby/whatever.  This is
a
short term gain, but still very powerful.  If you need flexibility and
abstraction excel takes you only so far, then you have to switch
language.
I am trying to convert vb to ruby automatically to make the switch
easier
and get the best of both worlds at different stages of development.



> Isn't there ActiveScriptRuby for that? Never actually tried it, just
> hearsay.
>

Thanks David, this looks *very* promising.  I'll check it out.
Corey L. (Guest)
on 2006-04-12 07:03
(Received via mailing list)
Well, you can sure automate Excel from Ruby...

look at the Win32OLE library...

You would maybe then want to encapsulate the Excel automation, perhaps
in some ActiveRecord::Base-derived class...

It's hard to beat doing certain things in Excel, but like any
development platform, there are a few good ways to do things and a LOT
of bad ways. Unfortunately, some of the bad ways are trivial to do...

-Corey L.
unknown (Guest)
on 2006-04-12 09:05
(Received via mailing list)
On Wed, 12 Apr 2006, Corey L. wrote:

> Well, you can sure automate Excel from Ruby...
>
> look at the Win32OLE library...
>
> You would maybe then want to encapsulate the Excel automation, perhaps
> in some ActiveRecord::Base-derived class...
>
> It's hard to beat doing certain things in Excel, but like any
> development platform, there are a few good ways to do things and a LOT
> of bad ways. Unfortunately, some of the bad ways are trivial to do...

and sometimes that includes excel

   http://www.agresearch.co.nz/Science/Statistics/exceluse1.htm
   http://72.14.203.104/search?q=cache:Hc48rjQucbMJ:w...


fyi.

-a
Chiaro S. (Guest)
on 2006-04-12 12:00
(Received via mailing list)
On 4/12/06, Corey L. <removed_email_address@domain.invalid> wrote:
>
> You would maybe then want to encapsulate the Excel automation, perhaps
> in some ActiveRecord::Base-derived class...
> It's hard to beat doing certain things in Excel, but like any
> development platform, there are a few good ways to do things and a LOT
> of bad ways. Unfortunately, some of the bad ways are trivial to do...
>

I agree, I am definetely working in that direction, although that
creates
some problems in easily distributing my excel apps and addins to
unrubyfied
users.
This topic is locked and can not be replied to.