FastFiber

Excel 2007 lib

Gestart door Joop, wo 08 10 2008, 12:27:18

Vorige topic - Volgende topic

Joop

Kan iemand mij vertellen hoe de library van Excel 2007 heet  :vraagteken:

B.v.d.

Joop
Een gelovig volger van
"de Sacrale Kunst van Luiheid",
zijn leider "Lisp" en acoliet "Script".

HofCAD

#1
Citaat van: Joop op wo 08 10 2008, 12:27:18
Kan iemand mij vertellen hoe de library van Excel 2007 heet  :vraagteken:

B.v.d.

Joop

Beste Joop,

Volgens onderstaand programma

(defun xL-Load-TypeLib-Excel ( / tlbfile tlbver out)
  (cond
    ( (or (null Excelm-Acosh) (null Excelp-get-value)(null Excelc-xl24HourClock))
      (if (setq tlbfile (xL-TypeLib-Excel))
        (progn
(setq tlbver (substr (vl-filename-base tlbfile) 6))
(cond
( (= tlbver "9")  (princ "\nInitializing Microsoft Excel 2000...") )
( (= tlbver "8")  (princ "\nInitializing Microsoft Excel 97...") )
( (= (vl-filename-base tlbfile) "Excel.exe")
(princ "\nInitializing Microsoft Excel XP...")
)
)
      (vlax-import-type-library
            :tlb-filename       tlbfile
        :methods-prefix "Excelm-"
        :properties-prefix "Excelp-"
        :constants-prefix "Excelc-"
      )
      (if Excelc-xl24HourClock (setq out T))
    )
  )
    )
    ( T (setq out T) )
  )
out
)


zou het Excel8.olb moeten heten.

Met vriendelijke groet, HofCAD CSI.

PS Zie ook bladzijde 35 van
www.midpointcad.com/au/docs/lakose_The_Visual_LISP_Developers_Bible.pdf -
Eigenlijk gek dat je dit vraagt, als ik je goed begrepen heb, want jij hebt mij ooit hiermee op weg geholpen.
http://www.cadsite.be/smf/index.php/topic,194.0.html
Waarvoor ik je nog steeds dankbaar ben.
ACADcadabra

Joop

Ik heb tot nu alleen de volgende versies:

(setq sysDrive (getenv "systemdrive"))

  ;;;--- If the excel object library is not found...load it
  (if (null Library)
    (progn

      ;;;--- Find out which version we should use
      (setq Library
        (cond
          ((findfile (strcat sysDrive "\\Program Files\\Microsoft Office\\Office\\Excel8.olb")))
          ((findfile (strcat sysDrive "\\Program Files\\Microsoft Office\\Office\\Excel9.olb")))
          ((findfile (strcat sysDrive "\\Program Files\\Microsoft Office\\Office\\Excel10.olb")))
          ((findfile (strcat sysDrive "\\Program Files\\Microsoft Office\\Office\\Excel.exe")))
          ((findfile (strcat sysDrive "\\Program Files\\Microsoft Office\\Office10\\Excel.exe")))
          ((findfile (strcat sysDrive "\\Program Files\\Microsoft Office\\Office11\\Excel.exe")))
          ((findfile (strcat sysDrive "\\Program Files\\Microsoft Office\\Office11\\XL5EN32.OLB")))
        )
      )

      ;;;--- If the library was found...
      (if Library
        (progn

          ;;;--- Strip off
          (setq LibVer (substr (vl-filename-base Library) 6))
          (cond
            ((= LibVer "8")(princ "\n Opening Excel Version 8..."))
            ((= LibVer "9")(princ "\n Opening Excel Version 9..."))
            ((= LibVer "1")(princ "\n Opening Excel Version 10..."))
            ((= LibVer "") (princ "\n Opening Excel Version 2000+..."))
            ((= LibVer "3")(princ "\n Opening Excel Version 2003..."))

          )
          (vlax-import-type-library
            :tlb-filename Library
            :methods-prefix "JXCL-"
            :properties-prefix "JXCL-"
            :constants-prefix "JXCL-"
          )
        )
        (alert "Excel Object Library was not found!\n\nLook inside the XL_Readme.txt file for HELP.")
      )
    )


Ik zoek versie 2007.
Om een of andere reden lukt het niet. :cry:
Een gelovig volger van
"de Sacrale Kunst van Luiheid",
zijn leider "Lisp" en acoliet "Script".

HofCAD

Beste Joop,

Sorry, ik had je vraag niet goed gelezen.
Maar volgens: http://support.microsoft.com/kb/219151

ClickProject and then click References. The References dialog box appears. Scroll down the list until you find Microsoft Excel object library, and then select the item to add a reference to Excel. If the correct object library for your version of Excel does not appear in the list, make sure that you have your version of Excel properly installed.

Notes
• If you are automating Microsoft Office Excel 2007, the type library appears as Microsoft Excel 12.0 Object Library in the References list.
• If you are automating Microsoft Office Excel 2003, the type library appears as Microsoft Excel 11.0 Object Library in the References list.
• If you are automating Microsoft Excel 2002, the type library appears as Microsoft Excel 10.0 Object Library in the References list
• If you are automating Microsoft Excel 2000, the type library appears as Microsoft Excel 9.0 Object Library in the References list.
• If you are automating Microsoft Excel 97, the type library appears as Microsoft Excel 8.0 Object Library in the References list

Hopelijk heb ik je hiermee geholpen.

Met vriendelijke groet, HofCAD CSI
ACADcadabra

Joop

Citaat van: HofCAD op do 09 10 2008, 09:34:19
Sorry, ik had je vraag niet goed gelezen.
Is niet erg hoor(bl.....). :wink:

Citaat van: HofCAD op do 09 10 2008, 09:34:19
Maar volgens: http://support.microsoft.com/kb/219151
Bedankt, hier heb ik niet aan gedacht (donker bl.....).  :oops:

Groetjes,

Joop
Een gelovig volger van
"de Sacrale Kunst van Luiheid",
zijn leider "Lisp" en acoliet "Script".