Author Topic: How do I load VLX and LISP files with VBA?  (Read 6732 times)

0 Members and 1 Guest are viewing this topic.

Atook

  • Swamp Rat
  • Posts: 1027
  • AKA Tim
Re: How???
« Reply #15 on: June 27, 2006, 03:13:38 PM »
..ThisDrawing.SendCommand "(load ""lispname.lsp"" (alert ""Load knackered.""))" & vbCr..


MP:

Are there too many quotes in the alert line?

(load "lispname.lsp" (alert "Load knackered.")) works for me, but I had to delete some of the quotes.

With the extra quotes the load tossed a binky..  :-D

Matersammichman

  • Guest
Re: How???
« Reply #16 on: June 27, 2006, 03:14:56 PM »
 :wink:It's all good...
All I had to do was add double backslashes.

Thanks all!

Bob Wahr

  • Guest
Re: How???
« Reply #17 on: June 27, 2006, 03:47:08 PM »
Atook, as a lisp statement, (load "lispname.lsp" (alert "Load knackered.")) is correct.  If you want that to work from vba though, it needs to be ThisDrawing.sendcommand "(load ""lispname.lsp"" (alert ""Load knackered.""))"

Double quotes("") in a string in VBA add a single quote(") to the string.  It's pretty much the same reason that you have to use a double backslash (\\) in lisp.

David Hall

  • Automatic Duh Generator
  • King Gator
  • Posts: 4075
Re: How???
« Reply #18 on: June 27, 2006, 04:21:00 PM »
Dont toss the binky....
Everyone has a photographic memory, Some just don't have film.
They say money can't buy happiness, but it can buy Bacon and that's a close second.
Sometimes the question is more important than the answer. (Thanks Kerry for reminding me)

Atook

  • Swamp Rat
  • Posts: 1027
  • AKA Tim
Re: How???
« Reply #19 on: June 27, 2006, 04:33:12 PM »
Thanks for pointing that out Bob, I should have seen it.

I always used Chr$(34) for a quote in VB6, but never had to evaluate a quote in VBA.

Good to know.

Bob Wahr

  • Guest
Re: How???
« Reply #20 on: June 27, 2006, 05:10:27 PM »
heh, missed the tossed the binky.  Chr$(34)/Chr(34)   works in VBA as well, I just couldn't remember the number so "" was easier.  AFAIR, "" works in VB6 as well.  When it gets down to it, it probably doesn't matter which way you skin the cat as long as it ends up on the fish hook.