Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Compile Error: Procedure too large
I am using the:
Private Sub UserForm_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single) routine to run a series of macro's, but not i get the 'Too large error'. I was thinking if i break up the code and place it into various Modules, and using a 'Call" procedure to run the macro with this procedure instead. However when i tried this it does not run. Can i remove the 'Private' and use a 'Public' to get it to work? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Compile Error: Procedure too large
You cannot put any userform events into any module other than the userform
module. What you have to do is extract parts of the code out into separate procedures that you call from the event code, and put those procedures into standard code modules. Private Sub UserForm_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single) 'some standard userform, stuff 'now call a procedure passing the form as an objec variable Call DoStuff(tHisForm:=Me) 'repeat this for discrete functional blocks End Sub in a standard code module PUBLIC DoStuff(ByRef ThisForm as Object) With ThisForm ... End With End Sub -- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "Corey ...." wrote in message ... I am using the: Private Sub UserForm_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single) routine to run a series of macro's, but not i get the 'Too large error'. I was thinking if i break up the code and place it into various Modules, and using a 'Call" procedure to run the macro with this procedure instead. However when i tried this it does not run. Can i remove the 'Private' and use a 'Public' to get it to work? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
VBA Compile error: Procedure too large? | Excel Discussion (Misc queries) | |||
Compile error: Procedure too large | Excel Programming | |||
Compile Error: Procedure too Large Question | Excel Programming | |||
Compile error: Procedure too large | Excel Programming | |||
Compile Error: Procedure too large | Excel Programming |