Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / January 2008

Tip: Looking for answers? Try searching our database.

Split Long Macro

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Doc60 - 21 Jan 2008 12:34 GMT
Hi,

I have a macro which will not run because it is to large. How do I split the
macro into two macros so that after the first macro the second automatically
runs. Could you please help me with the code. My macros are simply named
Macro 1 and Macro 2.

Thank you
Tony Jollans - 21 Jan 2008 12:45 GMT
If you don't know enough to do this on your own, I presume you have
relatively simple, if long, and probably recorded, macros so there shouldn't
be any major issues, and this may work ...

Sub Macro1
   ' Do a lot of stuff
   Macro2
End Sub
Sub Macro2
   ' do a lot more stuff
End Sub

Clearly this is simplistic, and if you do have complex code, copied from
elsewhere perhaps, there may be many things to consider and a more
comprehensive examination of the code will be needed to break it into
logical, independent, parts.

Signature

Enjoy,
Tony

> Hi,
>
[quoted text clipped - 6 lines]
>
> Thank you
fumei - 21 Jan 2008 18:51 GMT
"I have a macro which will not run because it is to large."

How, exactly, do you know this?  Are you getting an error message? If so,
what message?

>Hi,
>
[quoted text clipped - 4 lines]
>
>Thank you
Tony Jollans - 21 Jan 2008 19:08 GMT
Hi Gerry,

64K is the maximum size, above which you get a compile error: procedure too
large - unusual for its clarity.

Signature

Enjoy,
Tony

> "I have a macro which will not run because it is to large."
>
[quoted text clipped - 11 lines]
>>
>>Thank you
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.