Running Userform

N

Nedan Nedzatra

Hia

How can I run a Userform without enabling ActiveX or Macros and without
getting into VB Editor? Is there any way to have the list of Userforms (just
like the list of Macros)on the main Word interface?

Can you help Mates?

Nedan Nedzatra
 
J

Jay Freedman

On Tue, 15 Dec 2009 03:51:01 -0800, Nedan Nedzatra <Nedan
Hia

How can I run a Userform without enabling ActiveX or Macros and without
getting into VB Editor? Is there any way to have the list of Userforms (just
like the list of Macros)on the main Word interface?

Can you help Mates?

Nedan Nedzatra

No. Userforms are absolutely dependent on macros. If macros are
disabled, the userform can't run.

It sounds like you may have the macro security level set to High,
disabling macros. Change it to Medium, and enable macros when you're
prompted on opening the document.

There is no list of userforms other than in the Project Explorer pane
on the VBA editor.
 
N

Nedan Nedzatra

Hia

Thanks for responding Jay.

I am able to run User Forms from the VB Editor without enabling Macros and
ActiveX. I do it on Word 2007. I place the cursor on the User Form in the VBE
and click the Run Sub in the Run Menu or the tringular icon in the ribbon.
The codes are placed in Userform Initialize.
 
J

Jay Freedman

I think I misunderstood your original post.

The proper way to run a userform is to write an ordinary macro in a module
(not in ThisDocument or a Class Module) that calls the userform. Greg
Maxey's article at
http://gregmaxey.mvps.org/Create_and_employ_a_UserForm.htm shows a simple
example for displaying a userform named frmSurvey:

Sub CallUF()
Dim oFrm As frmSurvey
Set oFrm = New frmSurvey
oFrm.Show
Unload oFrm
Set oFrm = Nothing
End Sub

This macro will appear in the Macros dialog, and you can run it from there.

Another example is at
http://gregmaxey.mvps.org/Address_Letterhead_with_UserForm.htm, for a
userform named myFrm, and because that macro is named AutoNew it will run
automatically when a new document is created from the template that contains
the macro and its userform.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top