Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 45
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default 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
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
VBA Compile error: Procedure too large? Jerry Dyben Excel Discussion (Misc queries) 1 October 31st 05 10:15 PM
Compile error: Procedure too large BHARATH RAJAMANI Excel Programming 2 August 24th 05 10:24 PM
Compile Error: Procedure too Large Question Daniel R. Young Excel Programming 6 July 21st 05 08:01 PM
Compile error: Procedure too large Susan Hayes Excel Programming 2 May 20th 05 05:01 PM
Compile Error: Procedure too large mate Excel Programming 2 May 18th 04 04:30 PM


All times are GMT +1. The time now is 05:53 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"