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.
  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 51
Default MAximum Lines Of Code



"norie" wrote:

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.

Norie,

Thanks again for your interest.

I am a novice programmer and I am working on a very large project as a
learning experience.

I know my code could probably be much improved, but at this point in my
learning I am struggling just to learn how to make the code do what I want it
to do. Once I get proficient at making it work, I think I can go back and
learn how to make the code more efficient.

The project is an information retrieval system for a cruise travel company.
The idea is to record all cruises ordered, the passenger names, addresses,
birth dates, passport number, destinations, etc and to be able to quickly
retrieve the travel history, payment history and personal information on any
passenger. It is being written to accommodate up to 1000 reservation and
5000 passengers, with an archiving capability is the numbers exceed those
values.

My Excel workbook has 15 worksheets, 5 of which are operator interface for
various operator functions, 6 are reports, three are databases and 1 is a
scratch pad for computations.

As I said this is just for fun. I wasn't really looking for help with all of
this. I was just looking for information on any limitations there might be on
the size of the project.

Regards,

Jim Walsh
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:13 PM.

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"