Re: How to open VBA userform by sending some command from command bar?

#3
QuanNguyen wrote:
Tue Oct 15, 2024 6:28 pm
Hi,
You can create a new button and add it to a toolbar or menu.
The macro for the new button:

Code: Select all

C^C^P-vbarun "C:\IntelliCad\VBA_example.vbi!Module1.UserFormEx"
Please refer to the attached image.
CallUserForm.png
Thaks alot!!
I found the way later, by using Lisp
like this
---
(defun c:MMNu() ;MMNu is function name
(vl-load-com)
(setvar "cmdecho" 0)
(command "-vbarun" )
(command "MainMnu_UFS" ) ;MainMnu_UFS is VBA macro name
(setvar "cmdecho" 1)
)
----
I will try your method too
really appreciate
cron