PC Review


Reply
Thread Tools Rate Thread

Compile Error: Procedure too large

 
 
Corey ....
Guest
Posts: n/a
 
      25th Jul 2008
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 With Quote
 
 
 
 
Bob Phillips
Guest
Posts: n/a
 
      25th Jul 2008
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 ...." <(E-Mail Removed)> wrote in message
news:OQj%(E-Mail Removed)...
>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 With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Compile Error - Procedure too large DAVEYB Microsoft Excel Programming 7 1st Sep 2008 09:41 PM
Re: Compile error: Procedure too large Susan Hayes Microsoft Excel Programming 2 20th May 2005 05:01 PM
Compile Error - Procedure too large LB79 Microsoft Excel Misc 1 11th Aug 2004 06:08 PM
Compile Error: Procedure to Large Will Microsoft Access Reports 0 20th May 2004 07:36 PM
Compile Error: Procedure too large mate Microsoft Excel Programming 2 18th May 2004 04:30 PM


Features
 

Advertising
 

Newsgroups
 


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