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. |
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) |