Vba --> ruby: tool, parse or assimilation?

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 :slight_smile: has any of you tried
anything like that before?

···

--
Chiaroscuro
---
Liquid Development: http://liquiddevelopment.blogspot.com/

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/RubyAndVbaForWebDictionarySearches.html

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

···

--
James Britt

"The greatest obstacle to discovery is not ignorance, but the illusion of knowledge."
  - D. Boorstin

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 :slight_smile:
I'd love to be able to make a call to a Ruby COM Script Engine!

···

On 4/11/06, James Britt <james_b@neurogami.com> wrote:

--
Chiaroscuro
---
Liquid Development: http://liquiddevelopment.blogspot.com/

Dňa Utorok 11. Apríl 2006 20:18 chiaro scuro napísal:

> 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.

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 :stuck_out_tongue_winking_eye: 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 :slight_smile:
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 Vallner

···

On 4/11/06, James Britt <james_b@neurogami.com> wrote:

> 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 :stuck_out_tongue_winking_eye: An agile platform to
prototype
apps (and then some) that I've yet to come to the end of options of.
</fanboy>

:slight_smile: 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.

···

On 4/12/06, David Vallner <david@vallner.net> wrote:

--
Chiaroscuro
---
Liquid Development: http://liquiddevelopment.blogspot.com/

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 Lawson

···

On 4/11/06, chiaro scuro <kiaroskuro@gmail.com> wrote:

On 4/12/06, David Vallner <david@vallner.net> wrote:
>
> > 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.
> >
>

and sometimes that includes excel

   http://www.agresearch.co.nz/Science/Statistics/exceluse1.htm
   http://72.14.203.104/search?q=cache:Hc48rjQucbMJ:www.mis.coventry.ac.uk/~nhunt/pottel.pdf+accuracy+excel&hl=en&gl=us&ct=clnk&cd=6

fyi.

-a

···

On Wed, 12 Apr 2006, Corey Lawson 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...

--
be kind whenever possible... it is always possible.
- h.h. the 14th dali lama

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.

···

On 4/12/06, Corey Lawson <corey.ssf.lawson@gmail.com> 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...

--
Chiaroscuro
---
Liquid Development: http://liquiddevelopment.blogspot.com/