jpsheader.jpg (29354 bytes)

AutoLisp Home

Home

 

 

X

L

 

H

E

L

P

 

 

X

L

 

H

E

L

P

 

 

X

L

 

H

E

L

P

 

 

 

XL Help


If you are experiencing problems with XL, please take a look at some of the solutions below.  If this does not solve your problem, please see the email link at the bottom of the page.


  • FIRST!!!  Make sure you download the program from my website.  Other sites do not have the latest version.  If that does not solve your problem, continue below.

  • If you receive an error that looks like this:  XL; error: quit / exit abort

    • The XL.lsp program cannot find the DCL files.

      • Make sure all files are located somewhere in the autocad search path.   If you are not sure where this is :

        Go to the TOOLS drop down menu, go to PREFERENCES or OPTIONS (depending on your version of AutoCAD), go to the FILES tab.  Click the plus sign in front of "SUPPORT FILE SEARCH PATH".  The directories listed under here are the paths autocad searches for files. Then do one of the following:

        • 1.   Make sure the directory you stored the XL files is listed in here.  If not, add it by selecting the "ADD" button.

        • 2.  OR move all of the XL files into the autocad search path.  See above for instructions on finding the autocad search paths.


  • If you receive an error that looks like this:  error: no function definition: > JXCL-GET-ITEM

    • The EXCEL Object Library could not be found.

      • Make sure you are using a version of Excel from MicroSoft Excel Version 8.0 to 2000+

      • Deep breath......Microsoft EXCEL (and other major programs) come with a file called an Object Libarary.  This is a file for third party programs to access the objects inside the application.  For the Excel Object Library this would include objects like Workbooks, Sheets, Cells, Ranges, Cell Values, etc. 

        XL.lsp does a quick search for the object library using the standard install directories.  I did not do a complete hard drive search for these libraries because it would take too long.  So, if you've installed XL in a non-default directory OR your version of EXCEL is greater than 2005, you may have to change a line inside the XL_GET.lsp program.  

The lines to edit inside the XL.lsp program look like this:

((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")))

Let's disect it:

   The FINDFILE function searches autocad's search path for a file.  It returns the file name if found, and returns nil if not found.  The search paths can be found in the TOOLs drop down menu.  Go to PREFERENCES or OPTIONS depending on your version.  Go to the FILES tab and click the + sign in front of "SUPPORT FILE SEARCH PATH".  Here you will see the search paths listed.  

  The STRCAT function concatenates strings.  (strcat "A" "B") would return "AB".

  The SYSDRIVE function returns the drive letter of the drive where the system files are installed.  This is usually the same drive the microsoft programs are installed. 

  The PATH is in quotes preceding the file name.  Autolisp uses double "\" marks to indicate one "/".  Don't worry about it just take my word for it.  Notice the different paths for the different versions of Excel.   The last path, if I remember correctly is the default install directory for Excel 2005.

  The FILENAME is located after the last "\\".    These are the Excel Object Libraries.  Notice the different names used for each version.  Sometimes the library is a OLB file and sometimes it is inside the EXE file.  Go figure.

Okay.......Now what?  

   First of all, search your hard drive for OLB files.  If you find one, make sure it is one of the OLB files listed above.  (Excel8.olb, Excel9.olb, or Excel10.olb)  Change the path listed above to match the path you found the OLB file in.  Reload XL and try again. 

  Secondly, do the exact same thing as before with the OLB files except look for EXCEL*.exe.  If you find one,  change the path listed above to match the path you found the EXE file in and change the filename to match the one you found.  Reload XL and try again.

 


   FYI - You can determine if the FINDFILE function is finding the Excel Object Library by using the FINDFILE function on the command line.  Type your path and file name like the example below and press enter.

(findfile "C:\\Program Files\\Microsoft Office\\Office\\Excel.exe")

  If it returns the file name, it found the file.  If it returns NIL, the file was not found.  Keep trying.


Important note:

   This program was very difficult to write.  There are no books (to my knowledge) to research accessing Excel objects via Visual Lisp.  It was trial and error.  Very fustrating.  I talked with Bill Kramer at Autodesk and he suggested using the Excel macro recorder to figure out what objects were being accessed.   This was an excellent idea but, then he told me to "Guess" (that's right...he said guess) how to convert the VB code to Visual Lisp.  This was no fun at all as you could imagine.  I spent hours and hours attempting to access one property after another guessing at the syntax.

  For this reason I do not program custom Visual Lisp programs for Excel/AutoCAD without a substantial charge for the aggravation of guessing.    You may then still have trouble talking me into it, BUT, this does not mean I will not fix a problem with the XL program if you find one.

Another note: 

  There is a new program on my web site called GETCELLS.   This is a function you can use inside your own programs to get data from excel into a list for you to manipulate.  If you have some programming skills it should be self explanitory (after reading the notes inside the GETCELLS program).


If you still have problems, email me here.

If you have any questions about the program click here.

Back to top


AutoLisp Home

Home

All questions/complaints/suggestions should be sent to JefferyPSanders.com

Last Updated April 1st, 2013

Copyright 2002-2013 JefferyPSanders.com.  All rights reserved.