Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default UserForm OnAction

Hi,

I have created a userdefined CommandBar with a button.
From this button I would like to start a UserForm.

Usually I use something like the following Codeline to
call a Prozedu
..OnAction = MyCode

I wanted to do the same with the UserForm:
..OnAction = frmMyUserForm

Unfortunately it doesn't work.
Is it possible to allocate a UserForm?

Thank you,
Maria



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default UserForm OnAction

..OnAction = "MyCode"


Sub Mycode()
frmMyUserForm.Show
End sub

--
Regards,
Tom Ogilvy


"Maria" wrote in message
...
Hi,

I have created a userdefined CommandBar with a button.
From this button I would like to start a UserForm.

Usually I use something like the following Codeline to
call a Prozedu
.OnAction = MyCode

I wanted to do the same with the UserForm:
.OnAction = frmMyUserForm

Unfortunately it doesn't work.
Is it possible to allocate a UserForm?

Thank you,
Maria





  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default UserForm OnAction

Hi Tom,

unfortunately it doesn't work.

You can try it:

Sub test()
Dim cmb As CommandBar
Dim cmbp As CommandBarPopup

Set cmb = Application.CommandBars("Standard")
Set cmbp = cmb.Controls.Add(Type:=msoControlPopup)

cmbp.Caption = "test"

With cmbp.Controls.Add
.BeginGroup = True
.Caption = "test"
.FaceId = 231
.OnAction = frmMyUserForm.Show
End With
End Sub

Maria

-----Original Message-----
..OnAction = "MyCode"


Sub Mycode()
frmMyUserForm.Show
End sub

--
Regards,
Tom Ogilvy


"Maria" wrote in

message
...
Hi,

I have created a userdefined CommandBar with a button.
From this button I would like to start a UserForm.

Usually I use something like the following Codeline to
call a Prozedu
.OnAction = MyCode

I wanted to do the same with the UserForm:
.OnAction = frmMyUserForm

Unfortunately it doesn't work.
Is it possible to allocate a UserForm?

Thank you,
Maria





.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default UserForm OnAction

That isn't what I suggest. I suggested creating a macro that shows the
userform. then assigning that macro to the onaction property

Sub test()
Dim cmb As CommandBar
Dim cmbp As CommandBarPopup

Set cmb = Application.CommandBars("Standard")
Set cmbp = cmb.Controls.Add(Type:=msoControlPopup)

cmbp.Caption = "test"

With cmbp.Controls.Add
.BeginGroup = True
.Caption = "test"
.FaceId = 231
.OnAction = "Showform"
End With
End Sub

Sub Showform()
frmMyUserForm.Show
End Sub

sorry if my response appeared to indicate anything other than the above.

--
Regards,
Tom Ogilvy

"Maria" wrote in message
...
Hi Tom,

unfortunately it doesn't work.

You can try it:

Sub test()
Dim cmb As CommandBar
Dim cmbp As CommandBarPopup

Set cmb = Application.CommandBars("Standard")
Set cmbp = cmb.Controls.Add(Type:=msoControlPopup)

cmbp.Caption = "test"

With cmbp.Controls.Add
.BeginGroup = True
.Caption = "test"
.FaceId = 231
.OnAction = frmMyUserForm.Show
End With
End Sub

Maria

-----Original Message-----
..OnAction = "MyCode"


Sub Mycode()
frmMyUserForm.Show
End sub

--
Regards,
Tom Ogilvy


"Maria" wrote in

message
...
Hi,

I have created a userdefined CommandBar with a button.
From this button I would like to start a UserForm.

Usually I use something like the following Codeline to
call a Prozedu
.OnAction = MyCode

I wanted to do the same with the UserForm:
.OnAction = frmMyUserForm

Unfortunately it doesn't work.
Is it possible to allocate a UserForm?

Thank you,
Maria





.



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default UserForm OnAction

But Tom didn't suggest that.

He suggested something like:

Sub test()
Dim cmb As CommandBar
Dim cmbp As CommandBarPopup

Set cmb = Application.CommandBars("Standard")
Set cmbp = cmb.Controls.Add(Type:=msoControlPopup)

cmbp.Caption = "test"

With cmbp.Controls.Add
.BeginGroup = True
.Caption = "test"
.FaceId = 231
.OnAction = "MyCode"
End With
End Sub

Sub Mycode()
frmMyUserForm.Show
End sub



Maria wrote:

Hi Tom,

unfortunately it doesn't work.

You can try it:

Sub test()
Dim cmb As CommandBar
Dim cmbp As CommandBarPopup

Set cmb = Application.CommandBars("Standard")
Set cmbp = cmb.Controls.Add(Type:=msoControlPopup)

cmbp.Caption = "test"

With cmbp.Controls.Add
.BeginGroup = True
.Caption = "test"
.FaceId = 231
.OnAction = frmMyUserForm.Show
End With
End Sub

Maria

-----Original Message-----
..OnAction = "MyCode"


Sub Mycode()
frmMyUserForm.Show
End sub

--
Regards,
Tom Ogilvy


"Maria" wrote in

message
...
Hi,

I have created a userdefined CommandBar with a button.
From this button I would like to start a UserForm.

Usually I use something like the following Codeline to
call a Prozedu
.OnAction = MyCode

I wanted to do the same with the UserForm:
.OnAction = frmMyUserForm

Unfortunately it doesn't work.
Is it possible to allocate a UserForm?

Thank you,
Maria





.


--

Dave Peterson



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default UserForm OnAction

oh ... that's a way! :-)
Thank you.
Maria

-----Original Message-----
That isn't what I suggest. I suggested creating a macro

that shows the
userform. then assigning that macro to the onaction

property

Sub test()
Dim cmb As CommandBar
Dim cmbp As CommandBarPopup

Set cmb = Application.CommandBars("Standard")
Set cmbp = cmb.Controls.Add(Type:=msoControlPopup)

cmbp.Caption = "test"

With cmbp.Controls.Add
.BeginGroup = True
.Caption = "test"
.FaceId = 231
.OnAction = "Showform"
End With
End Sub

Sub Showform()
frmMyUserForm.Show
End Sub

sorry if my response appeared to indicate anything other

than the above.

--
Regards,
Tom Ogilvy

"Maria" wrote in

message
...
Hi Tom,

unfortunately it doesn't work.

You can try it:

Sub test()
Dim cmb As CommandBar
Dim cmbp As CommandBarPopup

Set cmb = Application.CommandBars("Standard")
Set cmbp = cmb.Controls.Add(Type:=msoControlPopup)

cmbp.Caption = "test"

With cmbp.Controls.Add
.BeginGroup = True
.Caption = "test"
.FaceId = 231
.OnAction = frmMyUserForm.Show
End With
End Sub

Maria

-----Original Message-----
..OnAction = "MyCode"


Sub Mycode()
frmMyUserForm.Show
End sub

--
Regards,
Tom Ogilvy


"Maria" wrote in

message
...
Hi,

I have created a userdefined CommandBar with a

button.
From this button I would like to start a UserForm.

Usually I use something like the following Codeline

to
call a Prozedu
.OnAction = MyCode

I wanted to do the same with the UserForm:
.OnAction = frmMyUserForm

Unfortunately it doesn't work.
Is it possible to allocate a UserForm?

Thank you,
Maria





.



.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
OnAction Variables Howiee22 Excel Programming 1 August 22nd 04 02:53 AM
OnAction to show a userform Todd Huttenstine Excel Programming 1 May 7th 04 04:17 PM
.OnAction with arguments max Excel Programming 4 February 23rd 04 06:30 PM
OnAction Jim Rech Excel Programming 1 September 5th 03 04:39 PM
OnAction Richard Yang Excel Programming 1 July 15th 03 01:37 PM


All times are GMT +1. The time now is 11:09 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"