Hi everyone,
Sorry for my poor English in advance.
I tried to write some VBA sub and want to find easy way to open the VBA userform.
How can I do it?
I hope I can call it from command bar, or set toolbar ribbon(I'm not sure its the right name, anyway the label on the top)
to call the userform.
Thanks!
Re: How to open VBA userform by sending some command from command bar?
#2Hi,
You can create a new button and add it to a toolbar or menu.
The macro for the new button:
Please refer to the attached image.
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"
Re: How to open VBA userform by sending some command from command bar?
#3Thaks alot!!QuanNguyen wrote: ↑Tue Oct 15, 2024 6:28 pmHi,
You can create a new button and add it to a toolbar or menu.
The macro for the new button:Please refer to the attached image.Code: Select all
C^C^P-vbarun "C:\IntelliCad\VBA_example.vbi!Module1.UserFormEx"
CallUserForm.png
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