Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 51
Default MAximum Lines Of Code

I found by accident that there is a maximum number of lines of code in a
single module in visual basic for Excel.

Is there a maximum number of lines of code for a project or for a workbook?

Thanks for your help,

Jim Walsh
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default MAximum Lines Of Code

There used to be reports that modules with 64k of code as text may cause
problems, personally I have never had a problem even with modules containing
somewhat more. I wouldn't be surprised if ultimately there's some maximum
lines limit (there is a characters wide limit).

However, it's generally not good practice nor necessary for a module to get
anywhere close to any theoretical size limit.

Regards,
Peter T

"jswalsh33" wrote in message
...
I found by accident that there is a maximum number of lines of code in a
single module in visual basic for Excel.

Is there a maximum number of lines of code for a project or for a
workbook?

Thanks for your help,

Jim Walsh



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 51
Default MAximum Lines Of Code



"Peter T" wrote:

There used to be reports that modules with 64k of code as text may cause
problems, personally I have never had a problem even with modules containing
somewhat more. I wouldn't be surprised if ultimately there's some maximum
lines limit (there is a characters wide limit).

However, it's generally not good practice nor necessary for a module to get
anywhere close to any theoretical size limit.

Regards,
Peter T

"jswalsh33" wrote in message
...
I found by accident that there is a maximum number of lines of code in a
single module in visual basic for Excel.

Is there a maximum number of lines of code for a project or for a
workbook?

Thanks for your help,

Jim Walsh


Peter,


Yes I learned that there is a maximum for a single module. I did not measure
it, but it was probably around 64K.

My question now is whether there is a maximum number of lines of code for a
project with many modules or maybe there is a maximum number of modules in a
single project.

Thanks for you help.

Jim Walsh

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 82
Default MAximum Lines Of Code

Jim

I don't think there is such a limit.

By the way if you are reaching the limits for lines of code it really
suggests that you should review your code.

Care to post a small sample?

Perhaps we could offer a few pointers on tidying up/shortening the
code.
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 51
Default MAximum Lines Of Code



"norie" wrote:

Jim

I don't think there is such a limit.

By the way if you are reaching the limits for lines of code it really
suggests that you should review your code.

Care to post a small sample?

Perhaps we could offer a few pointers on tidying up/shortening the
code.


Nori,

Thanks for your interest.
I really have too much code to list.
I have a single workbook with 41 Sub Routines (or Modules) of VB code.

I did have one sub that Excel warned me that I had too much code in that
Module so I split it into two modules and that worked fine.

My current issue is that Excel is doing some strange things as I add more
code and more modules. I was speculating that these may have been caused by
exceeding some limit on modules or code.

An example is that Excel crashes every time I click ok to the massage "This
action will reset your project, proceed anyway?" while editing code. If I
reset it myself it does not crash.

This does not happen on other smaller projects I have.

Regards,

Jim Walsh


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 82
Default MAximum Lines Of Code

Jim

I really, really think you need to have a rethink.

Why do you have 41 subs/modules?

I know splitting code into separate subs will work, but that's a bit
like putting a plaster on a head wound.:)

Can you post any of your code? Or perhaps an explanation of what it's
actually meant to do.
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
How do I set the Maximum Property for this Chart in code Ayo Excel Programming 1 April 13th 09 09:59 PM
How cani draw maximum and minimum lines in a chart in excel? Alf Charts and Charting in Excel 1 March 31st 08 09:09 AM
Maximum and Minimum Lines linking a chart chelo Charts and Charting in Excel 1 April 16th 07 12:39 PM
how to count maximum number of lines repeated for a site Igneshwara reddy[_2_] Excel Worksheet Functions 4 March 19th 07 04:24 PM
Does the Wrap function in excel allow a maximum number of lines? Redskins Fan Excel Discussion (Misc queries) 3 January 24th 06 06:11 PM


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