<?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: ThisWorkbook and the VBE Immediate Window</title>
	<atom:link href="http://www.dailydoseofexcel.com/archives/2006/03/17/thisworkbook-and-the-vbe-immediate-window/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.dailydoseofexcel.com/archives/2006/03/17/thisworkbook-and-the-vbe-immediate-window/</link>
	<description>Daily posts of Excel tips…and other stuff</description>
	<lastBuildDate>Thu, 09 Feb 2012 23:42:03 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: Zack Barresse</title>
		<link>http://www.dailydoseofexcel.com/archives/2006/03/17/thisworkbook-and-the-vbe-immediate-window/#comment-19268</link>
		<dc:creator>Zack Barresse</dc:creator>
		<pubDate>Thu, 23 Mar 2006 19:39:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=1373#comment-19268</guid>
		<description>&lt;p&gt;I use this quite a bit as well.  Although I generally tend to type out the name anyway.  As I do a lot of work in the VBE, sometimes I can have many projects open at once, and be flipping back and forth between them frequently.  I have had the misfortune of closing a few projects and losing some work because the active project may not have been the selected project.  Hehehe.  Hence me typing it all out generally.  LOL!&lt;/p&gt;
&lt;p&gt;Anyway, yes, good tip.  :)&lt;/p&gt;
&lt;p&gt;Regards,&lt;br&gt;
Zack Barresse&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>I use this quite a bit as well.  Although I generally tend to type out the name anyway.  As I do a lot of work in the VBE, sometimes I can have many projects open at once, and be flipping back and forth between them frequently.  I have had the misfortune of closing a few projects and losing some work because the active project may not have been the selected project.  Hehehe.  Hence me typing it all out generally.  LOL!</p>
<p>Anyway, yes, good tip.  <img src='http://www.dailydoseofexcel.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Regards,<br />
Zack Barresse</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rob van Gelder</title>
		<link>http://www.dailydoseofexcel.com/archives/2006/03/17/thisworkbook-and-the-vbe-immediate-window/#comment-19217</link>
		<dc:creator>Rob van Gelder</dc:creator>
		<pubDate>Fri, 17 Mar 2006 20:57:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=1373#comment-19217</guid>
		<description>&lt;p&gt;Stephen: very useful thanks. I can&#039;t tell you how many times I&#039;ve closed Add-Ins by typing the full name out... Can I have my wasted years back please?&lt;/p&gt;
&lt;p&gt;Eric W. Bachtal: &lt;&lt; So, for instance, if you select the Workbook object in a VBA project, which is named ThisWorkbook by default, and change its name to MyWorkbook, you can now refer to it as MyWorkbook in the Immediate window and in your code instead of ThisWorkbook. &gt;&gt;&lt;/p&gt;
&lt;p&gt;That is useful too, especially for Referenced Add-Ins.&lt;/p&gt;
&lt;p&gt;Not only is ThisWorkbook the default project name given to workbooks, but it&#039;s also a property of the Application object.&lt;/p&gt;
&lt;p&gt;So after you&#039;ve changed your workbook&#039;s project name to MyWorkbook, ThisWorkbook.Name is still valid.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Stephen: very useful thanks. I can&#8217;t tell you how many times I&#8217;ve closed Add-Ins by typing the full name out&#8230; Can I have my wasted years back please?</p>
<p>Eric W. Bachtal: &lt;&lt; So, for instance, if you select the Workbook object in a VBA project, which is named ThisWorkbook by default, and change its name to MyWorkbook, you can now refer to it as MyWorkbook in the Immediate window and in your code instead of ThisWorkbook. &gt;&gt;</p>
<p>That is useful too, especially for Referenced Add-Ins.</p>
<p>Not only is ThisWorkbook the default project name given to workbooks, but it&#8217;s also a property of the Application object.</p>
<p>So after you&#8217;ve changed your workbook&#8217;s project name to MyWorkbook, ThisWorkbook.Name is still valid.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Doug Glancy</title>
		<link>http://www.dailydoseofexcel.com/archives/2006/03/17/thisworkbook-and-the-vbe-immediate-window/#comment-19214</link>
		<dc:creator>Doug Glancy</dc:creator>
		<pubDate>Fri, 17 Mar 2006 19:41:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=1373#comment-19214</guid>
		<description>&lt;p&gt;Thanks Stephen, that is helpful.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Thanks Stephen, that is helpful.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eric W. Bachtal</title>
		<link>http://www.dailydoseofexcel.com/archives/2006/03/17/thisworkbook-and-the-vbe-immediate-window/#comment-19215</link>
		<dc:creator>Eric W. Bachtal</dc:creator>
		<pubDate>Fri, 17 Mar 2006 19:41:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=1373#comment-19215</guid>
		<description>&lt;p&gt;Just wanted to add that the name ThisWorkbook isn&#039;t an intrinsic name.  It is actually just the default name given to the Workbook object in a VBA project.  Each of the Workbook&#039;s Worksheet objects in the project is also given a name; they default to SheetX as new sheets are added, but their VBA project names do not have to match their Excel sheet names.  Excel VBA then provides global Workbook and Worksheet object variables with these names for us to use within our VBA projects.&lt;/p&gt;
&lt;p&gt;You can change the names of these global object variables in your VBA project by selecting the objects in the Project Explorer window under Microsoft Excel Objects and typing a new name in the Properties window.  So, for instance, if you select the Workbook object in a VBA project, which is named ThisWorkbook by default, and change its name to MyWorkbook, you can now refer to it as MyWorkbook in the Immediate window and in your code instead of ThisWorkbook.  You can also reference the Workbook&#039;s Worksheet objects directly using these global object variables, though folks rarely do this (there&#039;s real value in doing so, though, because it eliminates dependencies in the VBA code to Excel sheet names, allowing sheets to be renamed/moved in Excel without impacting any VBA code that might manipulate them).&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Just wanted to add that the name ThisWorkbook isn&#8217;t an intrinsic name.  It is actually just the default name given to the Workbook object in a VBA project.  Each of the Workbook&#8217;s Worksheet objects in the project is also given a name; they default to SheetX as new sheets are added, but their VBA project names do not have to match their Excel sheet names.  Excel VBA then provides global Workbook and Worksheet object variables with these names for us to use within our VBA projects.</p>
<p>You can change the names of these global object variables in your VBA project by selecting the objects in the Project Explorer window under Microsoft Excel Objects and typing a new name in the Properties window.  So, for instance, if you select the Workbook object in a VBA project, which is named ThisWorkbook by default, and change its name to MyWorkbook, you can now refer to it as MyWorkbook in the Immediate window and in your code instead of ThisWorkbook.  You can also reference the Workbook&#8217;s Worksheet objects directly using these global object variables, though folks rarely do this (there&#8217;s real value in doing so, though, because it eliminates dependencies in the VBA code to Excel sheet names, allowing sheets to be renamed/moved in Excel without impacting any VBA code that might manipulate them).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Billkamm</title>
		<link>http://www.dailydoseofexcel.com/archives/2006/03/17/thisworkbook-and-the-vbe-immediate-window/#comment-19213</link>
		<dc:creator>Billkamm</dc:creator>
		<pubDate>Fri, 17 Mar 2006 19:34:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=1373#comment-19213</guid>
		<description>&lt;p&gt;thanks Stephen that is very useful.  I always thought ThisWorkbook in the immediate window would refer to the open activeworkbook in the Excel window.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>thanks Stephen that is very useful.  I always thought ThisWorkbook in the immediate window would refer to the open activeworkbook in the Excel window.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John Walkenbach</title>
		<link>http://www.dailydoseofexcel.com/archives/2006/03/17/thisworkbook-and-the-vbe-immediate-window/#comment-19210</link>
		<dc:creator>John Walkenbach</dc:creator>
		<pubDate>Fri, 17 Mar 2006 18:35:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=1373#comment-19210</guid>
		<description>&lt;p&gt;Good one, Stephen. Like Jon, I&#039;ve been typing the filename to close an add-in. I&#039;ll bet I&#039;ve done that a thousand times.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Good one, Stephen. Like Jon, I&#8217;ve been typing the filename to close an add-in. I&#8217;ll bet I&#8217;ve done that a thousand times.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jon Peltier</title>
		<link>http://www.dailydoseofexcel.com/archives/2006/03/17/thisworkbook-and-the-vbe-immediate-window/#comment-19206</link>
		<dc:creator>Jon Peltier</dc:creator>
		<pubDate>Fri, 17 Mar 2006 16:19:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=1373#comment-19206</guid>
		<description>&lt;p&gt;Stephen -&lt;/p&gt;
&lt;p&gt;I accidentally discovered this about a month ago, and now I&#039;m amazed how much time it saves. I haven&#039;t had to type the name of an add-in I wanted to close (without uninstalling) in a long time.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Stephen -</p>
<p>I accidentally discovered this about a month ago, and now I&#8217;m amazed how much time it saves. I haven&#8217;t had to type the name of an add-in I wanted to close (without uninstalling) in a long time.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: charpentreau</title>
		<link>http://www.dailydoseofexcel.com/archives/2006/03/17/thisworkbook-and-the-vbe-immediate-window/#comment-19204</link>
		<dc:creator>charpentreau</dc:creator>
		<pubDate>Fri, 17 Mar 2006 14:56:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=1373#comment-19204</guid>
		<description>&lt;p&gt;if you write :&lt;/p&gt;
&lt;p&gt;ThisWorkbook.Close false&lt;/p&gt;
&lt;p&gt;you will close your project without saving the changes&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>if you write :</p>
<p>ThisWorkbook.Close false</p>
<p>you will close your project without saving the changes</p>
]]></content:encoded>
	</item>
</channel>
</rss>

