Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How do I set the Maximum Property for this Chart in code | Excel Programming | |||
How cani draw maximum and minimum lines in a chart in excel? | Charts and Charting in Excel | |||
Maximum and Minimum Lines linking a chart | Charts and Charting in Excel | |||
how to count maximum number of lines repeated for a site | Excel Worksheet Functions | |||
Does the Wrap function in excel allow a maximum number of lines? | Excel Discussion (Misc queries) |