Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hello all.
I was wondering if by chance there is a limit to how much code you can type into a vba Excel document. Is there a limit on how much code can go into one button or an entire userform? I ask this cause I get this error message; "Compile Error: Only comments may appear after End Sub, End Function or End Property" When it jumps me to see what's "wrong" it goes to highlight this line of code that is in the middle of a bunch of code. txtApt.Locked = True Which, to my knowledge has nothing to do with why the errors that are being generated. I'm hoping one of you out there might have some knowledge to share on any quirks with Excel and VBA. Thanks in advance. -LT |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
A general rule of thumb is that each module can contain a maximum of about 64k
characters. If you copy and paste into Notepad and save that file as *.txt, you can look at the size in windows explorer. But are you sure you don't have an End Sub or End Function right before this problem line? Remember to scroll all the way to the right to check. LT wrote: Hello all. I was wondering if by chance there is a limit to how much code you can type into a vba Excel document. Is there a limit on how much code can go into one button or an entire userform? I ask this cause I get this error message; "Compile Error: Only comments may appear after End Sub, End Function or End Property" When it jumps me to see what's "wrong" it goes to highlight this line of code that is in the middle of a bunch of code. txtApt.Locked = True Which, to my knowledge has nothing to do with why the errors that are being generated. I'm hoping one of you out there might have some knowledge to share on any quirks with Excel and VBA. Thanks in advance. -LT -- Dave Peterson |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]() Not necessarily true that that's where the error lies. Look at all of your code to see. -- Don Guillett SalesAid Software "LT" wrote in message oups.com... Hello all. I was wondering if by chance there is a limit to how much code you can type into a vba Excel document. Is there a limit on how much code can go into one button or an entire userform? I ask this cause I get this error message; "Compile Error: Only comments may appear after End Sub, End Function or End Property" When it jumps me to see what's "wrong" it goes to highlight this line of code that is in the middle of a bunch of code. txtApt.Locked = True Which, to my knowledge has nothing to do with why the errors that are being generated. I'm hoping one of you out there might have some knowledge to share on any quirks with Excel and VBA. Thanks in advance. -LT |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
On Mar 14, 3:48 pm, Dave Peterson wrote:
A general rule of thumb is that each module can contain a maximum of about 64k characters. If you copy and paste into Notepad and save that file as *.txt, you can look at the size in windows explorer. But are you sure you don't have an End Sub or End Function right before this problem line? Remember to scroll all the way to the right to check. LT wrote: Hello all. I was wondering if by chance there is a limit to how much code you can type into a vba Excel document. Is there a limit on how much code can go into one button or an entire userform? I ask this cause I get this error message; "Compile Error: Only comments may appear after End Sub, End Function or End Property" When it jumps me to see what's "wrong" it goes to highlight this line of code that is in the middle of a bunch of code. txtApt.Locked = True Which, to my knowledge has nothing to do with why the errors that are being generated. I'm hoping one of you out there might have some knowledge to share on any quirks with Excel and VBA. Thanks in advance. -LT -- Dave Peterson- Hide quoted text - - Show quoted text - Thanks for the lead on the size information, I didn't know that one. After doing as you suggested, all the code is stored on one userform and it adds up to 75.4 kb. A few years back I had similiar Excel VBA "weirdness" and attributed it to my lack of knowledge (I was just learning it then) and now I think it is possibly due to the size of all the code cause the module I had back then too had lots of code. I guess that's another example of what For Each and loop uses can be good for. While I had it in the text doc, I utilized the Word Wrap feature to see if there were any other End Sub's or such out of place or out of sync, and nadda. Going back to the size limits, I take it all the code on a userform has similar limitations to a module? Thanks again for your advice and help all. -LT |
#5
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I would guess that all modules suffer from the approximate 64k restriction. But
I've never approached that in a userform/worksheet/thisworkbook/class module. (I have had trouble in a General module--before I got dangerous!) LT wrote: On Mar 14, 3:48 pm, Dave Peterson wrote: A general rule of thumb is that each module can contain a maximum of about 64k characters. If you copy and paste into Notepad and save that file as *.txt, you can look at the size in windows explorer. But are you sure you don't have an End Sub or End Function right before this problem line? Remember to scroll all the way to the right to check. LT wrote: Hello all. I was wondering if by chance there is a limit to how much code you can type into a vba Excel document. Is there a limit on how much code can go into one button or an entire userform? I ask this cause I get this error message; "Compile Error: Only comments may appear after End Sub, End Function or End Property" When it jumps me to see what's "wrong" it goes to highlight this line of code that is in the middle of a bunch of code. txtApt.Locked = True Which, to my knowledge has nothing to do with why the errors that are being generated. I'm hoping one of you out there might have some knowledge to share on any quirks with Excel and VBA. Thanks in advance. -LT -- Dave Peterson- Hide quoted text - - Show quoted text - Thanks for the lead on the size information, I didn't know that one. After doing as you suggested, all the code is stored on one userform and it adds up to 75.4 kb. A few years back I had similiar Excel VBA "weirdness" and attributed it to my lack of knowledge (I was just learning it then) and now I think it is possibly due to the size of all the code cause the module I had back then too had lots of code. I guess that's another example of what For Each and loop uses can be good for. While I had it in the text doc, I utilized the Word Wrap feature to see if there were any other End Sub's or such out of place or out of sync, and nadda. Going back to the size limits, I take it all the code on a userform has similar limitations to a module? Thanks again for your advice and help all. -LT -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Strange Happenings | Excel Discussion (Misc queries) | |||
WIERD Excel Problem | Setting up and Configuration of Excel | |||
Wierd Copy and Paste | Excel Discussion (Misc queries) | |||
Wierd event | Excel Discussion (Misc queries) | |||
Wierd XL Behavior | Excel Discussion (Misc queries) |