[plt-scheme] Scripting Excel with MysterX

From: Ben Simon (benjisimon at gmail.com)
Date: Fri Jun 12 15:19:22 EDT 2009

Howdy all,

I've got a project coming up that looks like it's going to require me to
write some VB code in Excel. That is, unless I can put together a Scheme
solution first :-).

I've made some progress with MysterX and scripting excel by following the
example here:
   http://www.perlmonks.org/index.pl?node_id=153486

Here's what I have so far:

(require mysterx)
(let* ([excel (com-get-active-object-from-coclass "Microsoft Office Excel
Application")]
        [book (com-invoke (com-get-property excel "Workbooks") "Add")])
  (com-get-property book "Worksheets"))

What I'm stuck on, is that I believe Worksheets is an associative array, and
I'm trying to get a hold of Sheet1. Or, as they say in perl:

my $Sheet = $Book->Worksheets("Sheet1");

I can get the value of the Worksheets property, but I can't index into it.

Essentially, I'm asking the same question raised here:
http://tinyurl.com/mmuffa - as next I need to figure out how to access
ranges and other goodies.

Thanks for the help - and an especially big thanks if you get me out of
coding in VB ;-)

-Ben

--
Have an idea for software?  I can make it happen -
http://www.ideas2executables.com
My Blog: http://benjisimon.blogspot.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20090612/5ed3afa8/attachment.html>

Posted on the users mailing list.