From: JulioBP \(Uady, desde casa\)

Subject: request for help

Date: 2003-5-27 14:46

Hello

I have not seen examples on how to connect lisp 
with other apps, other than the ones Franz provided. 

I've already figured out how to start and close excel
from within Lisp, using the ole automation example provided
(ole/sample2/ieexplorer.cl), and came up with the
following:

(in-package :cg-user)
(defparameter Excel-classid
  (ole:unique-guid "{00024500-0000-0000-C000-000000000046}"))
(progn 
  (ole:with-open-registry-key (Excel-reg ole:rkey-classes-root
          `("CLSID" ,(ole:guid-name Excel-classid))
          :error-return nil)
     (when (null Excel-reg)
    (format t "Sorry, no excel on this system~2%")
       (return-from test nil)))  ;;; Just like the ie example, 
                                 ;;; but using excel class id.
  (ole:start-ole)
  (setf Excel-tool 
    (ole:ask-for-autotool
     Excel-classid
     ole:CLSCTX_LOCAL_SERVER))  ;; Assigning the reference 
                                ;; to the App variable
  (setf (ole::auto-getf Excel-tool :visible) t)    ; to show
  (ole:auto-method excel-tool :findfile)          ; Open the xl-find 
dialog 
  (ole:auto-method excel-tool :GetOpenFilename) ; Open the xl-Open 
  (setf xlValor (ole:auto-getf 
                  excel-tool :value)) ;;; Getting the value of 
                                      ;;; the Application
  )

 but I will appreciate if you can inform me 
on things like the equivalent lisp-code for vba instruction like:

Workbooks.Add
Workbooks.Open FileName:="Example.xls"
Workbooks("Example.xls").Worksheets("Sheet1").Range("A1").Activate 
ActiceCell.Value = "Hello world"
...and any other you could provide me

Thanks for your kind attention

======================
Dr. Julio R. Baeza Pereyra
Universidad Autónoma de Yucatán
Facultad de Ingeniería.
Av. Industrias no contaminantes s/n
por Periférico Norte.
Mérida, Yucatán, México