Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Art Art is offline
external usenet poster
 
Posts: 587
Default Raising Events

Hi,

I've got a form "frmLoadAccount" with a label on it "uxLoad".
My form has the following code in it:

Public Event testEvent()

Private Sub uxLoad_Click()
RaiseEvent testEvent
End Sub

(I like labels better than buttons)


I have a class "Account" with the following code in it:

Public WithEvents xFrm As frmLoadAccount

Public Sub Init()
Set xFrm = New frmLoadAccount
xFrm.Show
End Sub

Public Sub xFrm_testEvent()
Stop
End Sub

My hope was that by clicking on the "uxLoad", I would trigger "testEvent",
and run the "xFrm_testEvent". The debugger gets to the RaiseEvent statement,
but then nothing. Am I doing something wrong?

I tried to do this by running a sub inside the code for the form and that
DID work. I'm wondering if there's a problem because I try to raise an event
from within an event handler.

I'd appreciate any help.



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Raising Events


To Call A macro inside another MAcro then You just have to call it, you
do not need to place the macro inside a macro


Code:
--------------------
Sub CallFruit()
Fruit' calls the macro Fruit
End Sub
Sub Fruit()
MsgBox "Fruit"
End Sub

--------------------


--
Stringer
------------------------------------------------------------------------
Stringer's Profile: http://www.thecodecage.com/forumz/member.php?userid=117
View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=62594

  #3   Report Post  
Posted to microsoft.public.excel.programming
Art Art is offline
external usenet poster
 
Posts: 587
Default Raising Events

Stringer,

Thanks for getting back to me. My problem is a little different. I'm not
trying to call a macro, I'm trying to raise an event which would cause code
to execute in another macro. Now it may be that my solution is to just call
the other macro -- I'm not sure, but it's late and I'm not thinking as
clearly as I should.

Even if abandoning my approach is the best answer, I still wonder about
raising an event within an event handler.


"Stringer" wrote:


To Call A macro inside another MAcro then You just have to call it, you
do not need to place the macro inside a macro


Code:
--------------------
Sub CallFruit()
Fruit' calls the macro Fruit
End Sub
Sub Fruit()
MsgBox "Fruit"
End Sub

--------------------


--
Stringer
------------------------------------------------------------------------
Stringer's Profile: http://www.thecodecage.com/forumz/member.php?userid=117
View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=62594


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
Fund Raising Chart samiauthor Charts and Charting in Excel 1 December 28th 09 09:39 PM
raising multiple cells containing numbers by a percentage Tammy Dean[_2_] Excel Discussion (Misc queries) 3 July 11th 08 02:48 PM
UDF Raising an error DMc2005 Excel Worksheet Functions 3 October 13th 05 11:46 PM
UDF Raising an error DMc2005 Excel Programming 3 October 13th 05 11:46 PM


All times are GMT +1. The time now is 03:40 AM.

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"