<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Module Size Limits</title>
	<atom:link href="http://www.dailydoseofexcel.com/archives/2004/10/13/module-size-limits/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.dailydoseofexcel.com/archives/2004/10/13/module-size-limits/</link>
	<description>Daily posts of Excel tips…and other stuff</description>
	<lastBuildDate>Wed, 08 Feb 2012 23:58:05 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: Zabrina</title>
		<link>http://www.dailydoseofexcel.com/archives/2004/10/13/module-size-limits/#comment-36525</link>
		<dc:creator>Zabrina</dc:creator>
		<pubDate>Wed, 17 Dec 2008 19:57:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=808#comment-36525</guid>
		<description>&lt;p&gt;OMG!! Your blog entry about Excel VB size limited saved me from getting fired on my job!!!! My excel file kept crashing on me because I&#039;ve written all my codes behind the userform and the userform is 120K. Not until my friend send me your link, then I understand about the limitations and I moved all the codes behind the form onto 6 different modules (about 20-30 k each), then it resolved the file crashing problem. &lt;/p&gt;
&lt;p&gt;THANK YOU SO MUCH Santa!!!!!!!!!! This is the BEST x&#039;mas GIFT EVER!!!!!!!!!!!&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>OMG!! Your blog entry about Excel VB size limited saved me from getting fired on my job!!!! My excel file kept crashing on me because I&#8217;ve written all my codes behind the userform and the userform is 120K. Not until my friend send me your link, then I understand about the limitations and I moved all the codes behind the form onto 6 different modules (about 20-30 k each), then it resolved the file crashing problem. </p>
<p>THANK YOU SO MUCH Santa!!!!!!!!!! This is the BEST x&#8217;mas GIFT EVER!!!!!!!!!!!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tim</title>
		<link>http://www.dailydoseofexcel.com/archives/2004/10/13/module-size-limits/#comment-16866</link>
		<dc:creator>Tim</dc:creator>
		<pubDate>Sun, 16 Oct 2005 04:16:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=808#comment-16866</guid>
		<description>&lt;p&gt;When compiled, the code for a procedure can&#039;t exceed 64K.&lt;/p&gt;
&lt;p&gt;I can&#039;t believe no one knows this.  The key word is &quot;compiled&quot;.  I get these errors all the time.  I have to find ways to reduce the &quot;compiled&quot; size.&lt;/p&gt;
&lt;p&gt;So far I have been able to each time.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>When compiled, the code for a procedure can&#8217;t exceed 64K.</p>
<p>I can&#8217;t believe no one knows this.  The key word is &#8220;compiled&#8221;.  I get these errors all the time.  I have to find ways to reduce the &#8220;compiled&#8221; size.</p>
<p>So far I have been able to each time.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Roger Crawley</title>
		<link>http://www.dailydoseofexcel.com/archives/2004/10/13/module-size-limits/#comment-2422</link>
		<dc:creator>Roger Crawley</dc:creator>
		<pubDate>Wed, 20 Oct 2004 11:41:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=808#comment-2422</guid>
		<description>&lt;p&gt;I followed your link to Stephen Bullen&#039;s new site (19-Oct-2004).&lt;/p&gt;
&lt;p&gt;I downloaded his VBETools utility which among other things provides a module size on the toolbar, if you have it displayed.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>I followed your link to Stephen Bullen&#8217;s new site (19-Oct-2004).</p>
<p>I downloaded his VBETools utility which among other things provides a module size on the toolbar, if you have it displayed.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kevin</title>
		<link>http://www.dailydoseofexcel.com/archives/2004/10/13/module-size-limits/#comment-2421</link>
		<dc:creator>Kevin</dc:creator>
		<pubDate>Wed, 13 Oct 2004 22:17:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=808#comment-2421</guid>
		<description>&lt;p&gt;Felt pretty good about my code until Andy posted his comment.  He always makes me feel like I should buy Computers for Dummies.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Felt pretty good about my code until Andy posted his comment.  He always makes me feel like I should buy Computers for Dummies.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andy Pope</title>
		<link>http://www.dailydoseofexcel.com/archives/2004/10/13/module-size-limits/#comment-2420</link>
		<dc:creator>Andy Pope</dc:creator>
		<pubDate>Wed, 13 Oct 2004 22:12:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=808#comment-2420</guid>
		<description>&lt;p&gt;Not done any real testing on this but it appears to be quite accurate.&lt;br&gt;
Result in KB&#039;s&lt;/p&gt;
&lt;p&gt;Enter this in the Immediate pane, making sure the code module is active.&lt;br&gt;
?len(application.VBE.ActiveCodePane.CodeModule.Lines(1,application.VBE.ActiveCodePane.CodeModule.CountOfLines))/1000&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Not done any real testing on this but it appears to be quite accurate.<br />
Result in KB&#8217;s</p>
<p>Enter this in the Immediate pane, making sure the code module is active.<br />
?len(application.VBE.ActiveCodePane.CodeModule.Lines(1,application.VBE.ActiveCodePane.CodeModule.CountOfLines))/1000</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kevin</title>
		<link>http://www.dailydoseofexcel.com/archives/2004/10/13/module-size-limits/#comment-2419</link>
		<dc:creator>Kevin</dc:creator>
		<pubDate>Wed, 13 Oct 2004 21:08:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=808#comment-2419</guid>
		<description>&lt;p&gt;I too have searched in vain for a method to determine the size of a module, and finally ended up creating a method to quickly check it.  &lt;/p&gt;
&lt;p&gt;It&#039;s not the best, but it creates a foundation you could use to do something like loop through all modules in a project and show their size.  I never got to the point of doing that, however -- this just works for a module in the same project that this code is in, and you have to specify the module name (it also works for forms).&lt;/p&gt;
&lt;p&gt;It&#039;s not the best, but it&#039;s a bit faster than the method described above!  Let me know if you find any way to improve upon it. &lt;/p&gt;
&lt;p&gt;Sub get_Mod_Size()&lt;br&gt;
    Dim myProject As Object&lt;br&gt;
    Dim ComName As String&lt;br&gt;
    Dim tempPath As String&lt;br&gt;
    Dim fs As Object, a As Object&lt;br&gt;
    Dim result As String&lt;/p&gt;
&lt;p&gt;&#039; **************************************************************************************&lt;br&gt;
&#039;   Use this to determine the size of a module&lt;br&gt;
&#039;   Set ModName (component name) and tempPath (where to store the temp fule), then run&lt;br&gt;
&#039; **************************************************************************************&lt;/p&gt;
&lt;p&gt;&#039;   Set these to run&lt;br&gt;
    ComName = &quot;UserForm1?&lt;br&gt;
    tempPath = &quot;c: 01 test.bas&quot;&lt;/p&gt;
&lt;p&gt;&#039;   ***** No action needed after this point *****&lt;/p&gt;
&lt;p&gt;&#039;   Export the component (module, form, etc) - this is only temporary&lt;br&gt;
    Set myProject = Application.VBE.ActiveVBProject.VBComponents&lt;br&gt;
    myProject(ComName).Export (tempPath)&lt;/p&gt;
&lt;p&gt;&#039;   Get the size of the file created&lt;br&gt;
    Set fs = CreateObject(&quot;Scripting.FileSystemObject&quot;)&lt;br&gt;
    Set a = fs.getfile(tempPath)&lt;br&gt;
    result = ComName &amp; &quot; uses &quot; &amp; (a.Size / 1000) &amp; &quot; KB.&quot;&lt;/p&gt;
&lt;p&gt;&#039;   Return the file size&lt;br&gt;
    MsgBox result, vbExclamation&lt;/p&gt;
&lt;p&gt;&#039;   Delete the exported file&lt;br&gt;
    fs.Deletefile tempPath&lt;/p&gt;
&lt;p&gt;End Sub&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>I too have searched in vain for a method to determine the size of a module, and finally ended up creating a method to quickly check it.  </p>
<p>It&#8217;s not the best, but it creates a foundation you could use to do something like loop through all modules in a project and show their size.  I never got to the point of doing that, however &#8212; this just works for a module in the same project that this code is in, and you have to specify the module name (it also works for forms).</p>
<p>It&#8217;s not the best, but it&#8217;s a bit faster than the method described above!  Let me know if you find any way to improve upon it. </p>
<p>Sub get_Mod_Size()<br />
    Dim myProject As Object<br />
    Dim ComName As String<br />
    Dim tempPath As String<br />
    Dim fs As Object, a As Object<br />
    Dim result As String</p>
<p>&#8216; **************************************************************************************<br />
&#8216;   Use this to determine the size of a module<br />
&#8216;   Set ModName (component name) and tempPath (where to store the temp fule), then run<br />
&#8216; **************************************************************************************</p>
<p>&#8216;   Set these to run<br />
    ComName = &#8220;UserForm1?<br />
    tempPath = &#8220;c: 01 test.bas&#8221;</p>
<p>&#8216;   ***** No action needed after this point *****</p>
<p>&#8216;   Export the component (module, form, etc) &#8211; this is only temporary<br />
    Set myProject = Application.VBE.ActiveVBProject.VBComponents<br />
    myProject(ComName).Export (tempPath)</p>
<p>&#8216;   Get the size of the file created<br />
    Set fs = CreateObject(&#8220;Scripting.FileSystemObject&#8221;)<br />
    Set a = fs.getfile(tempPath)<br />
    result = ComName &amp; &#8221; uses &#8221; &amp; (a.Size / 1000) &amp; &#8221; KB.&#8221;</p>
<p>&#8216;   Return the file size<br />
    MsgBox result, vbExclamation</p>
<p>&#8216;   Delete the exported file<br />
    fs.Deletefile tempPath</p>
<p>End Sub</p>
]]></content:encoded>
	</item>
</channel>
</rss>

