Author Topic: vl-vbaload  (Read 8850 times)

0 Members and 1 Guest are viewing this topic.

Humbertogo

  • Guest
vl-vbaload
« on: March 07, 2006, 05:50:27 AM »
When I try to use it using the vl-vbaload, it never loads:


Command: (vl-vbaload "test.dvb")'VLIDE ; error: Automation Error. Problem
in
loading DVB file


Is there more to using this function than what is in the help file?

thanks


Jim Yadon

  • Guest
Re: vl-vbaload
« Reply #1 on: March 07, 2006, 06:08:21 AM »
You might try here first

I know this topic has been gone over in various incarnations and different applications in several threads.

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: vl-vbaload
« Reply #2 on: March 07, 2006, 07:13:01 AM »
The "usual" cause for that message is the file not being found on the ACAD path.

Perhaps try something like this ;
Code: [Select]
(if (setq tmp (findfile "test.dvb"))
  (vl-vbaload tmp)
  ;; else
  (prompt "\n Unable to find file")
)
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

ElpanovEvgeniy

  • Water Moccasin
  • Posts: 1569
  • Moscow (Russia)
Re: vl-vbaload
« Reply #3 on: March 07, 2006, 07:28:37 AM »
Code: [Select]
(if (vl-catch-all-error-p
      (vl-catch-all-apply
'vl-vbaload
(list
  (findfile "test.dvb")
) ;_  list
      ) ;_  vl-catch-all-apply
    ) ;_  vl-catch-all-error-p
  (vl-vbaload
    (list
      (getfiled "Select a VBA File \"test.dvb\"" "" "dvb" 8)
    ) ;_  list
  ) ;_  vl-vbaload
)

Humbertogo

  • Guest
Re: vl-vbaload
« Reply #4 on: March 07, 2006, 08:26:14 AM »
it seen that i can not load the function from the acaddoc.lsp
when i load it from the vlisp editor or from the appload command the function
is working OK

i use

;(load "test")
 (vl-load-all "test.lsp")
but isn't load

kpblc

  • Bull Frog
  • Posts: 396
Re: vl-vbaload
« Reply #5 on: March 07, 2006, 08:37:58 AM »
I think the best way is load your application through _appload window. I prefer do not change acaddoc.lsp and acad.lsp files.
Sorry for my English.

Jürg Menzi

  • Swamp Rat
  • Posts: 599
  • Oberegg, Switzerland
Re: vl-vbaload
« Reply #6 on: March 07, 2006, 09:19:46 AM »
My 2¢:
(vl-vbarun "MyVba.dvb!MyModul.MySub")
Load and start in one step...
There are some known problems if the dvb is loaded on startup...
A computer's human touch is its unscrupulousness!
MENZI ENGINEERING GmbH
Current A2k16... A2k24 - Start R2.18

Humbertogo

  • Guest
Re: vl-vbaload
« Reply #7 on: March 07, 2006, 09:38:57 AM »
Jürg

(vl-vbarun "MyVba.dvb!MyModul.MySub")

will give "Execution Error" that what i try to remove

acc ADN

;;; Issue      While executing a VBA macro from LISP, a statement that says "Execution Error"
;;;            is echoed on the command line.. My macro seems to work correctly, however, why
;;;            is the statement always there?

;;; The best way to run a VBA macro from LISP is to use the automation interface and
;;;            not the command function. Your AutoLISP code should look like the following:

Jürg Menzi

  • Swamp Rat
  • Posts: 599
  • Oberegg, Switzerland
Re: vl-vbaload
« Reply #8 on: March 07, 2006, 10:32:27 AM »
Is the dvb in a folder of the acad environment?
Or
Probably you've an error in the vba code... can you compile the project?
« Last Edit: March 07, 2006, 10:38:37 AM by Jürg Menzi »
A computer's human touch is its unscrupulousness!
MENZI ENGINEERING GmbH
Current A2k16... A2k24 - Start R2.18

Humbertogo

  • Guest
Re: vl-vbaload
« Reply #9 on: March 08, 2006, 01:20:17 AM »
The dvb  file is finding in the support files path
my vba project have not error

Jürg Menzi

  • Swamp Rat
  • Posts: 599
  • Oberegg, Switzerland
Re: vl-vbaload
« Reply #10 on: March 08, 2006, 02:08:35 AM »
I'm finished with my knowledge... :-(
You may post the dvb to check this behaviour...
A computer's human touch is its unscrupulousness!
MENZI ENGINEERING GmbH
Current A2k16... A2k24 - Start R2.18

Chuck Gabriel

  • Guest
Re: vl-vbaload
« Reply #11 on: March 08, 2006, 08:17:13 AM »
You can try putting (arxload "acadvba.arx") before the line where you load your dvb.  It's not likely to help, but it's certainly worth a try.

Jurg is correct though.  We need more pieces of the puzzle before we can offer anything really helpful.

Humbertogo

  • Guest
Re: vl-vbaload
« Reply #12 on: March 08, 2006, 09:38:34 AM »
This is the code what i use.

I copy the dvb file in to start in Folder and it working well (DWGPREFIX )
But when i copy the file in another folder in the support file search path
i get the err

Command: (RunVBAMacro "MsgBoxHello.dvb" "MyTestProject.MyModule.TestMacro")
; error: Automation Error. Problem in loading DVB file


(defun RunVBAMacro (dvbfilename vbaMacro / acadApplication dvbfile)
 ;; Load ActiveX   
 (vl-load-com)
  (setq acadApplication (vlax-get-acad-object))
  (setq dvbfile (findfile dvbfilename))
  (if dvbfile
   (progn (vla-LoadDVB acadApplication dvbfile) 
      (vla-RunMacro acadApplication vbaMacro)
   );progn
  )
  (if acadApplication
    (if   (null (vlax-object-released-p acadApplication))
      (progn (vlax-release-object acadApplication)
        (setq acadApplication nil)
      )
    )
  )
  (princ)
)

Jürg Menzi

  • Swamp Rat
  • Posts: 599
  • Oberegg, Switzerland
Re: vl-vbaload
« Reply #13 on: March 08, 2006, 10:47:18 AM »
That's all what you have to use:
Code: [Select]
(defun RunVBAMacro (dvbfilename vbaMacro / dvbfile)
 (vl-load-com)
 (if (setq dvbfile (findfile dvbfilename))
  (vl-vbarun (strcat dvbfile "!" vbaMacro))
 )
 (princ)
)
Call:
(RunVBAMacro "MsgBoxHello.dvb" "MyModule.TestMacro")
Note:
Don't use the project name...
And
How about the rights in this folder?
« Last Edit: March 08, 2006, 10:51:59 AM by Jürg Menzi »
A computer's human touch is its unscrupulousness!
MENZI ENGINEERING GmbH
Current A2k16... A2k24 - Start R2.18

Humbertogo

  • Guest
Re: vl-vbaload
« Reply #14 on: March 08, 2006, 11:31:44 AM »
The code is only working when i copy it in to the acaddoc.lsp..
but not when i load it as file (RunVBAMacro.lsp).!!!

Jürg Menzi

  • Swamp Rat
  • Posts: 599
  • Oberegg, Switzerland
Re: vl-vbaload
« Reply #15 on: March 08, 2006, 11:42:00 AM »
Hmmm...

First load:
(load "RunVBAMacro.lsp")
then run:
(RunVBAMacro "MsgBoxHello.dvb" "MyModule.TestMacro")
should work...
A computer's human touch is its unscrupulousness!
MENZI ENGINEERING GmbH
Current A2k16... A2k24 - Start R2.18

Humbertogo

  • Guest
Re: vl-vbaload
« Reply #16 on: March 08, 2006, 11:55:14 AM »
That exact what i do.. :grazy:

Humbertogo

  • Guest
Re: vl-vbaload
« Reply #17 on: March 08, 2006, 12:24:32 PM »
thanks guys

it's something wrong whit me system i just try in another an working fine :-D

Jürg Menzi

  • Swamp Rat
  • Posts: 599
  • Oberegg, Switzerland
Re: vl-vbaload
« Reply #18 on: March 08, 2006, 12:53:02 PM »
Otherwise I'm at my wits' end... :roll:
A computer's human touch is its unscrupulousness!
MENZI ENGINEERING GmbH
Current A2k16... A2k24 - Start R2.18