<?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: How To: Assign a Macro to a Button or Shape</title>
	<atom:link href="http://peltiertech.com/WordPress/how-to-assign-a-macro-to-a-button-or-shape/feed/" rel="self" type="application/rss+xml" />
	<link>http://peltiertech.com/WordPress/how-to-assign-a-macro-to-a-button-or-shape/</link>
	<description>PTS Excel Charts and Tutorials Blog</description>
	<lastBuildDate>Sat, 21 Nov 2009 04:01:08 -0600</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
	<item>
		<title>By: Mei</title>
		<link>http://peltiertech.com/WordPress/how-to-assign-a-macro-to-a-button-or-shape/comment-page-1/#comment-12184</link>
		<dc:creator>Mei</dc:creator>
		<pubDate>Fri, 20 Mar 2009 03:53:19 +0000</pubDate>
		<guid isPermaLink="false">http://peltiertech.com/WordPress/2008/03/12/how-to-assign-a-macro-to-a-button-or-shape/#comment-12184</guid>
		<description>Thanks Jon, will try it out and share any further problems if I encounter them.

Cheers.</description>
		<content:encoded><![CDATA[<p>Thanks Jon, will try it out and share any further problems if I encounter them.</p>
<p>Cheers.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jon Peltier</title>
		<link>http://peltiertech.com/WordPress/how-to-assign-a-macro-to-a-button-or-shape/comment-page-1/#comment-12183</link>
		<dc:creator>Jon Peltier</dc:creator>
		<pubDate>Fri, 20 Mar 2009 03:23:25 +0000</pubDate>
		<guid isPermaLink="false">http://peltiertech.com/WordPress/2008/03/12/how-to-assign-a-macro-to-a-button-or-shape/#comment-12183</guid>
		<description>Could you use a regular button as opposed to a shape for this? I&#039;ve heard that using buttons (use Forms toolbar buttons, which nominally work just like shapes) is more reliable than using shapes.</description>
		<content:encoded><![CDATA[<p>Could you use a regular button as opposed to a shape for this? I&#8217;ve heard that using buttons (use Forms toolbar buttons, which nominally work just like shapes) is more reliable than using shapes.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mei</title>
		<link>http://peltiertech.com/WordPress/how-to-assign-a-macro-to-a-button-or-shape/comment-page-1/#comment-12179</link>
		<dc:creator>Mei</dc:creator>
		<pubDate>Thu, 19 Mar 2009 23:59:59 +0000</pubDate>
		<guid isPermaLink="false">http://peltiertech.com/WordPress/2008/03/12/how-to-assign-a-macro-to-a-button-or-shape/#comment-12179</guid>
		<description>Hi Jon,
Thank you for your reply. Indeed I am using Excel 2007, on a Vista OS. 

It&#039;s a simple macro to copy &amp; paste by appending to a columnn of values. I assigned this macro to a shape that I drew somewhere on the worksheet. When I click the enabled shape, it works fine, however, the moment i move the shape to another part of the worksheet - even if it&#039;s near by, the macros become very unstable. They work some of the time, and fail altogether at others. 

It&#039;s quite strange. 

Many thanks.
Mei.</description>
		<content:encoded><![CDATA[<p>Hi Jon,<br />
Thank you for your reply. Indeed I am using Excel 2007, on a Vista OS. </p>
<p>It&#8217;s a simple macro to copy &amp; paste by appending to a columnn of values. I assigned this macro to a shape that I drew somewhere on the worksheet. When I click the enabled shape, it works fine, however, the moment i move the shape to another part of the worksheet &#8211; even if it&#8217;s near by, the macros become very unstable. They work some of the time, and fail altogether at others. </p>
<p>It&#8217;s quite strange. </p>
<p>Many thanks.<br />
Mei.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jon Peltier</title>
		<link>http://peltiertech.com/WordPress/how-to-assign-a-macro-to-a-button-or-shape/comment-page-1/#comment-12161</link>
		<dc:creator>Jon Peltier</dc:creator>
		<pubDate>Thu, 19 Mar 2009 10:45:39 +0000</pubDate>
		<guid isPermaLink="false">http://peltiertech.com/WordPress/2008/03/12/how-to-assign-a-macro-to-a-button-or-shape/#comment-12161</guid>
		<description>Mei -

I have never experienced this problem exactly. What version of Excel are you using? There are a couple funny things about assigning macros to shapes in Excel 2007. If that&#039;s your version I would like to try to replicate the problem.</description>
		<content:encoded><![CDATA[<p>Mei -</p>
<p>I have never experienced this problem exactly. What version of Excel are you using? There are a couple funny things about assigning macros to shapes in Excel 2007. If that&#8217;s your version I would like to try to replicate the problem.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mei</title>
		<link>http://peltiertech.com/WordPress/how-to-assign-a-macro-to-a-button-or-shape/comment-page-1/#comment-12157</link>
		<dc:creator>Mei</dc:creator>
		<pubDate>Thu, 19 Mar 2009 04:46:25 +0000</pubDate>
		<guid isPermaLink="false">http://peltiertech.com/WordPress/2008/03/12/how-to-assign-a-macro-to-a-button-or-shape/#comment-12157</guid>
		<description>Hi Jon
I encounter sporadic problems when assigning macros to objects - i.e. the macros fail to run when the objects are re-positioned on the same worksheet.  Sometimes they work, and sometimes they don&#039;t! There doesn&#039;t seem to be anything wrong with the macros themselves. 

Would you happen to know why or have a solution for this?

Many thanks.
Mei
Malaysia</description>
		<content:encoded><![CDATA[<p>Hi Jon<br />
I encounter sporadic problems when assigning macros to objects &#8211; i.e. the macros fail to run when the objects are re-positioned on the same worksheet.  Sometimes they work, and sometimes they don&#8217;t! There doesn&#8217;t seem to be anything wrong with the macros themselves. </p>
<p>Would you happen to know why or have a solution for this?</p>
<p>Many thanks.<br />
Mei<br />
Malaysia</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jon Peltier</title>
		<link>http://peltiertech.com/WordPress/how-to-assign-a-macro-to-a-button-or-shape/comment-page-1/#comment-8746</link>
		<dc:creator>Jon Peltier</dc:creator>
		<pubDate>Thu, 22 Jan 2009 12:02:15 +0000</pubDate>
		<guid isPermaLink="false">http://peltiertech.com/WordPress/2008/03/12/how-to-assign-a-macro-to-a-button-or-shape/#comment-8746</guid>
		<description>Excel proposed a default macro name that mimics a click event (e.g., Rectangle1_Click), but it isn&#039;t really an event in the sense that a command button or other ActiveX control has events it can respond to. You can only assign the name of an existing macro.

In the Excel object model, shapes expose no events that your code can respond to. The worksheet itself has a limited set of events you can code against, while charts and AcitveX controls have a rich set of events you can exploit.</description>
		<content:encoded><![CDATA[<p>Excel proposed a default macro name that mimics a click event (e.g., Rectangle1_Click), but it isn&#8217;t really an event in the sense that a command button or other ActiveX control has events it can respond to. You can only assign the name of an existing macro.</p>
<p>In the Excel object model, shapes expose no events that your code can respond to. The worksheet itself has a limited set of events you can code against, while charts and AcitveX controls have a rich set of events you can exploit.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ricardo</title>
		<link>http://peltiertech.com/WordPress/how-to-assign-a-macro-to-a-button-or-shape/comment-page-1/#comment-8743</link>
		<dc:creator>Ricardo</dc:creator>
		<pubDate>Thu, 22 Jan 2009 10:48:33 +0000</pubDate>
		<guid isPermaLink="false">http://peltiertech.com/WordPress/2008/03/12/how-to-assign-a-macro-to-a-button-or-shape/#comment-8743</guid>
		<description>I`d like to assign a macro(MouseMove) to a shape like you show above, but whan i click on the shape and chosse Assign Macro, the event assign is always the click event. So my doubt is, could i assing another event like MouseMove instead of Click ?

Tks for your help.</description>
		<content:encoded><![CDATA[<p>I`d like to assign a macro(MouseMove) to a shape like you show above, but whan i click on the shape and chosse Assign Macro, the event assign is always the click event. So my doubt is, could i assing another event like MouseMove instead of Click ?</p>
<p>Tks for your help.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jon Peltier</title>
		<link>http://peltiertech.com/WordPress/how-to-assign-a-macro-to-a-button-or-shape/comment-page-1/#comment-6942</link>
		<dc:creator>Jon Peltier</dc:creator>
		<pubDate>Tue, 16 Dec 2008 21:54:36 +0000</pubDate>
		<guid isPermaLink="false">http://peltiertech.com/WordPress/2008/03/12/how-to-assign-a-macro-to-a-button-or-shape/#comment-6942</guid>
		<description>Intriguing. In Excel 2003, I created a column chart and wrote this code:

&lt;pre class=&quot;vbasmall&quot;&gt;Sub Sample()
  If ActiveChart Is Nothing Then
    MsgBox &quot;Select a chart&quot;
  Else
    ActiveChart.ChartType = xlLine
  End If
End Sub&lt;/pre&gt;
 
Then I inserted a Forms button and a shape, and applied this macro to both. If I select the chart and click the button, the chart type changes. If I select the chart, change it back to a column chart, and click on the shape, again the chart type changes. The chart remains selected, though after the macro runs it is selected with white handels, meaning the shape containing the chart is actually what is selected.</description>
		<content:encoded><![CDATA[<p>Intriguing. In Excel 2003, I created a column chart and wrote this code:</p>
<pre class="vbasmall">Sub Sample()
  If ActiveChart Is Nothing Then
    MsgBox "Select a chart"
  Else
    ActiveChart.ChartType = xlLine
  End If
End Sub</pre>
<p> <br />
Then I inserted a Forms button and a shape, and applied this macro to both. If I select the chart and click the button, the chart type changes. If I select the chart, change it back to a column chart, and click on the shape, again the chart type changes. The chart remains selected, though after the macro runs it is selected with white handels, meaning the shape containing the chart is actually what is selected.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Victor</title>
		<link>http://peltiertech.com/WordPress/how-to-assign-a-macro-to-a-button-or-shape/comment-page-1/#comment-6937</link>
		<dc:creator>Victor</dc:creator>
		<pubDate>Tue, 16 Dec 2008 20:48:08 +0000</pubDate>
		<guid isPermaLink="false">http://peltiertech.com/WordPress/2008/03/12/how-to-assign-a-macro-to-a-button-or-shape/#comment-6937</guid>
		<description>Actually, I simply inserted a shape into a worksheet, made a chart just somewhere on the worksheet, assigned a macro to the &quot;Shape&quot; (not button ;) that is supposed to transfer my chart but I get my error alert saying &quot;please select a chart&quot; when I click on the macro associated shape. 
If I use a button from the form control, everything is a ok .
The problem I believe lies with the following ; when I select a chart to transfer, then hit the &quot;Shape&quot; that I&#039;ve assigned a macro to (the macro doing the transferring) I believe excel &quot;deselects&quot; the prior selected chart and instead selects the shape then activates the macro causing the above mentioned error.
I would use a button instead of the &quot;shape&quot; but the shape looks cool :).</description>
		<content:encoded><![CDATA[<p>Actually, I simply inserted a shape into a worksheet, made a chart just somewhere on the worksheet, assigned a macro to the &#8220;Shape&#8221; (not button ;) that is supposed to transfer my chart but I get my error alert saying &#8220;please select a chart&#8221; when I click on the macro associated shape.<br />
If I use a button from the form control, everything is a ok .<br />
The problem I believe lies with the following ; when I select a chart to transfer, then hit the &#8220;Shape&#8221; that I&#8217;ve assigned a macro to (the macro doing the transferring) I believe excel &#8220;deselects&#8221; the prior selected chart and instead selects the shape then activates the macro causing the above mentioned error.<br />
I would use a button instead of the &#8220;shape&#8221; but the shape looks cool :).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jon Peltier</title>
		<link>http://peltiertech.com/WordPress/how-to-assign-a-macro-to-a-button-or-shape/comment-page-1/#comment-6928</link>
		<dc:creator>Jon Peltier</dc:creator>
		<pubDate>Tue, 16 Dec 2008 18:54:22 +0000</pubDate>
		<guid isPermaLink="false">http://peltiertech.com/WordPress/2008/03/12/how-to-assign-a-macro-to-a-button-or-shape/#comment-6928</guid>
		<description>Victor -

If the button is a Forms toolbar button, it interacts with a macro the same way as a shape (right click &gt; Assign Macro...). If it&#039;s a controls toolbox button, the protocol is different, as described in &lt;a href=&quot;http://peltiertech.com/WordPress/2008/03/13/how-to-assign-a-macro-to-an-activex-control/&quot; title=&quot;Assign a Macro to an ActiveX Control&quot; rel=&quot;nofollow&quot;&gt;How To: Assign a Macro to an ActiveX Control&lt;/a&gt;.

Or do you mean you added shapes to the chart? If you select the chart, then insert the shape, the shape is part of the chart. If you just added the shape, it&#039;s part of the worksheet, not the chart, and grouping the chart to the shape makes another shape, which the chart objects code will not recognize.</description>
		<content:encoded><![CDATA[<p>Victor -</p>
<p>If the button is a Forms toolbar button, it interacts with a macro the same way as a shape (right click > Assign Macro&#8230;). If it&#8217;s a controls toolbox button, the protocol is different, as described in <a href="http://peltiertech.com/WordPress/2008/03/13/how-to-assign-a-macro-to-an-activex-control/" title="Assign a Macro to an ActiveX Control" rel="nofollow">How To: Assign a Macro to an ActiveX Control</a>.</p>
<p>Or do you mean you added shapes to the chart? If you select the chart, then insert the shape, the shape is part of the chart. If you just added the shape, it&#8217;s part of the worksheet, not the chart, and grouping the chart to the shape makes another shape, which the chart objects code will not recognize.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
