<?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: Passing Arguments Through OnAction</title>
	<atom:link href="http://www.dailydoseofexcel.com/archives/2004/06/03/passing-arguments-through-onaction/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.dailydoseofexcel.com/archives/2004/06/03/passing-arguments-through-onaction/</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: Federico</title>
		<link>http://www.dailydoseofexcel.com/archives/2004/06/03/passing-arguments-through-onaction/#comment-38283</link>
		<dc:creator>Federico</dc:creator>
		<pubDate>Mon, 02 Mar 2009 15:01:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=597#comment-38283</guid>
		<description>&lt;p&gt;How can I pass to the .onaction a string indicating a form (included in my main.xls project) to be opened ?&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>How can I pass to the .onaction a string indicating a form (included in my main.xls project) to be opened ?</p>
<p>Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Robert Eversman</title>
		<link>http://www.dailydoseofexcel.com/archives/2004/06/03/passing-arguments-through-onaction/#comment-37778</link>
		<dc:creator>Robert Eversman</dc:creator>
		<pubDate>Thu, 05 Feb 2009 18:17:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=597#comment-37778</guid>
		<description>&lt;p&gt;That&#039;s it thanks for the solution!&lt;/p&gt;
&lt;p&gt;If I wasn&#039;t a complete hack I&#039;m sure I could have found a way not require a sub for each check box...&lt;/p&gt;
&lt;p&gt;But due to time constraints that&#039;s not the way it went down.&lt;/p&gt;
&lt;p&gt;thanks for your time!&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>That&#8217;s it thanks for the solution!</p>
<p>If I wasn&#8217;t a complete hack I&#8217;m sure I could have found a way not require a sub for each check box&#8230;</p>
<p>But due to time constraints that&#8217;s not the way it went down.</p>
<p>thanks for your time!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dick Kusleika</title>
		<link>http://www.dailydoseofexcel.com/archives/2004/06/03/passing-arguments-through-onaction/#comment-37769</link>
		<dc:creator>Dick Kusleika</dc:creator>
		<pubDate>Thu, 05 Feb 2009 14:32:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=597#comment-37769</guid>
		<description>&lt;p&gt;Your expectation doesn&#039;t have any double quotes, so don&#039;t put any in your code.&lt;/p&gt;
&lt;div style=&quot;overflow: auto; white-space: nowrap;&quot; class=&quot;codecolorer-container text default&quot;&gt;&lt;div style=&quot;white-space: nowrap;&quot; class=&quot;text codecolorer&quot;&gt;.OnAction = &quot;&#039;Close&quot; &amp; WOrderNum &amp; &quot;&#039;&quot;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Are you creating a separate sub for every checkbox?  Surely you can just use one sub for all the checkboxes.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Your expectation doesn&#8217;t have any double quotes, so don&#8217;t put any in your code.</p>
<div style="overflow: auto; white-space: nowrap;" class="codecolorer-container text default">
<div style="white-space: nowrap;" class="text codecolorer">.OnAction = &#8220;&#8216;Close&#8221; &amp; WOrderNum &amp; &#8220;&#8216;&#8221;</div>
</div>
<p>Are you creating a separate sub for every checkbox?  Surely you can just use one sub for all the checkboxes.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Robert Eversman</title>
		<link>http://www.dailydoseofexcel.com/archives/2004/06/03/passing-arguments-through-onaction/#comment-37747</link>
		<dc:creator>Robert Eversman</dc:creator>
		<pubDate>Wed, 04 Feb 2009 20:00:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=597#comment-37747</guid>
		<description>&lt;p&gt;HELP PLZ!&lt;/p&gt;
&lt;p&gt;I am passing a variable string through an .OnAction I get everything to come out ok EXCEPT I have extra quotation marks around the variable!&lt;/p&gt;
&lt;p&gt;I expect to see the following title for the Sub Name:    MyFile.xls!&#039;Close200002&#039;&lt;br&gt;
But in stead I get:                                      MyFile.xls!&#039;Close&quot;200002?&#039;&lt;br&gt;
I am unable to get rid of the extra quotation marks (which are an invalid Sub title, otherwise I wouldn&#039;t have a problem...)&lt;br&gt;
When I try to remove a set of quotation marks I get:     MyFile.xls!&#039;Close&quot; &amp; WOrderNum &amp; &quot;&#039;&lt;br&gt;
Which is obviously not what I want since it isn&#039;t taking the variable for the file name.&lt;/p&gt;
&lt;p&gt;I&#039;m not a VB Pro just a hack, so plz excuse the code. I&#039;m using excel 2007 and this is only a small portion of the code I believe to be applicable.&lt;/p&gt;
&lt;div style=&quot;overflow: auto; white-space: nowrap;&quot; class=&quot;codecolorer-container vb default&quot;&gt;&lt;div style=&quot;white-space: nowrap;&quot; class=&quot;vb codecolorer&quot;&gt;&lt;span class=&quot;kw1&quot;&gt;Sub&lt;/span&gt; Try0&lt;br&gt;
&lt;br&gt;
&lt;span class=&quot;kw1&quot;&gt;Dim&lt;/span&gt; WOrderNum &lt;span class=&quot;kw1&quot;&gt;As&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;String&lt;/span&gt;&lt;br&gt;
&lt;br&gt;
Range(&lt;span class=&quot;st0&quot;&gt;&quot;P8&quot;&lt;/span&gt;).&lt;span class=&quot;kw1&quot;&gt;Select&lt;/span&gt;&lt;br&gt;
ThisWorkbook.Names.Add Name:=&lt;span class=&quot;st0&quot;&gt;&quot;WOrderNum&quot;&lt;/span&gt;, RefersTo:=&lt;span class=&quot;st0&quot;&gt;&quot;=$P$8&quot;&lt;/span&gt;, Visible:=&lt;span class=&quot;kw1&quot;&gt;True&lt;/span&gt; &#160; &#160; &#160; &#160; &lt;br&gt;
&lt;br&gt;
WOrderNum = Range(&lt;span class=&quot;st0&quot;&gt;&quot;WOrderNum&quot;&lt;/span&gt;) &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &lt;span class=&quot;co1&quot;&gt;&#039; In this case the WOrderNum is 200002 referenced from cell P8&lt;br&gt;
&lt;/span&gt;&lt;br&gt;
Range(&lt;span class=&quot;st0&quot;&gt;&quot;Q8&quot;&lt;/span&gt;).&lt;span class=&quot;kw1&quot;&gt;Select&lt;/span&gt; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &lt;span class=&quot;co1&quot;&gt;&#039; INSERT CHECKBOX SUB FOR CLOSING&lt;br&gt;
&lt;/span&gt; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;ActiveSheet.CheckBoxes.Add(1850, 201, 112, 10).&lt;span class=&quot;kw1&quot;&gt;Select&lt;/span&gt;&lt;br&gt;
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &lt;span class=&quot;kw1&quot;&gt;With&lt;/span&gt; Selection&lt;br&gt;
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; .Name = M8&lt;br&gt;
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; .LinkedCell = &lt;span class=&quot;st0&quot;&gt;&quot;L8&quot;&lt;/span&gt;&lt;br&gt;
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; .Value = xlOff&lt;br&gt;
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; .Characters.Text = &lt;span class=&quot;st0&quot;&gt;&quot;Check Box to CLOSE WO&quot;&lt;/span&gt;&lt;br&gt;
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; .OnAction = &lt;span class=&quot;st0&quot;&gt;&quot;&#039;Close&quot;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&quot;&quot;&lt;/span&gt; &amp; WOrderNum &amp; &lt;span class=&quot;st0&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&quot;&#039;&quot;&lt;/span&gt; &#160; &#160; &#160; &#160;&lt;span class=&quot;co1&quot;&gt;&#039;&lt;=---- This is where problem is believed to exist!&lt;br&gt;
&lt;/span&gt; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;Range(&lt;span class=&quot;st0&quot;&gt;&quot;Q8&quot;&lt;/span&gt;).&lt;span class=&quot;kw1&quot;&gt;Select&lt;/span&gt;&lt;br&gt;
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &lt;span class=&quot;kw1&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;With&lt;/span&gt;&lt;br&gt;
&lt;br&gt;
&lt;span class=&quot;co1&quot;&gt;&#039;Down here later in the code I have the Macro record a new macro &lt;br&gt;
&lt;/span&gt;&lt;br&gt;
&lt;span class=&quot;kw1&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Sub&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;This part of the program is adding check boxes for Work Orders, which are then clicked to close the work order. The sub that is executed .OnAction closes the work order. (a very annoying sub to write since I couldn&#039;t find a great way to have a macro write another macro...)&lt;/p&gt;
&lt;p&gt;Please tell me if you have any ideas as I feel like I&#039;ve tried all the quotation mark combos that can possibly exist!&lt;/p&gt;
&lt;p&gt;thanks.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>HELP PLZ!</p>
<p>I am passing a variable string through an .OnAction I get everything to come out ok EXCEPT I have extra quotation marks around the variable!</p>
<p>I expect to see the following title for the Sub Name:    MyFile.xls!&#8217;Close200002&#8242;<br />
But in stead I get:                                      MyFile.xls!&#8217;Close&#8221;200002?&#8217;<br />
I am unable to get rid of the extra quotation marks (which are an invalid Sub title, otherwise I wouldn&#8217;t have a problem&#8230;)<br />
When I try to remove a set of quotation marks I get:     MyFile.xls!&#8217;Close&#8221; &amp; WOrderNum &amp; &#8220;&#8216;<br />
Which is obviously not what I want since it isn&#8217;t taking the variable for the file name.</p>
<p>I&#8217;m not a VB Pro just a hack, so plz excuse the code. I&#8217;m using excel 2007 and this is only a small portion of the code I believe to be applicable.</p>
<div style="overflow: auto; white-space: nowrap;" class="codecolorer-container vb default">
<div style="white-space: nowrap;" class="vb codecolorer"><span class="kw1">Sub</span> Try0</p>
<p><span class="kw1">Dim</span> WOrderNum <span class="kw1">As</span> <span class="kw1">String</span></p>
<p>Range(<span class="st0">&#8220;P8&#8243;</span>).<span class="kw1">Select</span><br />
ThisWorkbook.Names.Add Name:=<span class="st0">&#8220;WOrderNum&#8221;</span>, RefersTo:=<span class="st0">&#8220;=$P$8&#8243;</span>, Visible:=<span class="kw1">True</span> &nbsp; &nbsp; &nbsp; &nbsp; </p>
<p>WOrderNum = Range(<span class="st0">&#8220;WOrderNum&#8221;</span>) &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">&#8216; In this case the WOrderNum is 200002 referenced from cell P8<br />
</span><br />
Range(<span class="st0">&#8220;Q8&#8243;</span>).<span class="kw1">Select</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">&#8216; INSERT CHECKBOX SUB FOR CLOSING<br />
</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ActiveSheet.CheckBoxes.Add(1850, 201, 112, 10).<span class="kw1">Select</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">With</span> Selection<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .Name = M8<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .LinkedCell = <span class="st0">&#8220;L8&#8243;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .Value = xlOff<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .Characters.Text = <span class="st0">&#8220;Check Box to CLOSE WO&#8221;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .OnAction = <span class="st0">&#8220;&#8216;Close&#8221;</span><span class="st0">&#8220;&#8221;</span> &amp;amp; WOrderNum &amp;amp; <span class="st0">&#8220;&#8221;</span><span class="st0">&#8220;&#8216;&#8221;</span> &nbsp; &nbsp; &nbsp; &nbsp;<span class="co1">&#8216;&amp;lt;=&#8212;- This is where problem is believed to exist!<br />
</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Range(<span class="st0">&#8220;Q8&#8243;</span>).<span class="kw1">Select</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">End</span> <span class="kw1">With</span></p>
<p><span class="co1">&#8216;Down here later in the code I have the Macro record a new macro <br />
</span><br />
<span class="kw1">End</span> <span class="kw1">Sub</span></div>
</div>
<p>This part of the program is adding check boxes for Work Orders, which are then clicked to close the work order. The sub that is executed .OnAction closes the work order. (a very annoying sub to write since I couldn&#8217;t find a great way to have a macro write another macro&#8230;)</p>
<p>Please tell me if you have any ideas as I feel like I&#8217;ve tried all the quotation mark combos that can possibly exist!</p>
<p>thanks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tom West</title>
		<link>http://www.dailydoseofexcel.com/archives/2004/06/03/passing-arguments-through-onaction/#comment-34888</link>
		<dc:creator>Tom West</dc:creator>
		<pubDate>Thu, 25 Sep 2008 17:40:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=597#comment-34888</guid>
		<description>&lt;p&gt;How do you clear the OnAction property? Settign it to &quot;&quot; or vbNullString doesn&#039;t end up with thinsg as they were before the OnAction property was doen in the first place.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>How do you clear the OnAction property? Settign it to &#8220;&#8221; or vbNullString doesn&#8217;t end up with thinsg as they were before the OnAction property was doen in the first place.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rine</title>
		<link>http://www.dailydoseofexcel.com/archives/2004/06/03/passing-arguments-through-onaction/#comment-33789</link>
		<dc:creator>Rine</dc:creator>
		<pubDate>Wed, 23 Jul 2008 10:32:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=597#comment-33789</guid>
		<description>&lt;p&gt;Sry, made a mistake at the button name. :p&lt;/p&gt;
&lt;div style=&quot;overflow: auto; white-space: nowrap;&quot; class=&quot;codecolorer-container vb default&quot;&gt;&lt;div style=&quot;white-space: nowrap;&quot; class=&quot;vb codecolorer&quot;&gt;&lt;span class=&quot;kw1&quot;&gt;Private&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Sub&lt;/span&gt; Main_Click()&lt;br&gt;
&lt;br&gt;
Sheets.Add&lt;br&gt;
ActiveSheet.Buttons.Add(144, 38.25, 57, 21).&lt;span class=&quot;kw1&quot;&gt;Select&lt;/span&gt;&lt;br&gt;
Selection.OnAction = &lt;span class=&quot;st0&quot;&gt;&quot;DisplayMessage&quot;&lt;/span&gt;&lt;br&gt;
ActiveSheet.Shapes(&lt;span class=&quot;st0&quot;&gt;&quot;Button 1&quot;&lt;/span&gt;).&lt;span class=&quot;kw1&quot;&gt;Select&lt;/span&gt;&lt;br&gt;
Selection.Characters.Text = &lt;span class=&quot;st0&quot;&gt;&quot;Display Msg&quot;&lt;/span&gt;&lt;br&gt;
&lt;span class=&quot;kw1&quot;&gt;With&lt;/span&gt; Selection.Characters(Start:=1, Length:=11).Font&lt;br&gt;
.Name = &lt;span class=&quot;st0&quot;&gt;&quot;Arial&quot;&lt;/span&gt;&lt;br&gt;
.FontStyle = &lt;span class=&quot;st0&quot;&gt;&quot;Regular&quot;&lt;/span&gt;&lt;br&gt;
.Size = 10&lt;br&gt;
.Strikethrough = &lt;span class=&quot;kw1&quot;&gt;False&lt;/span&gt;&lt;br&gt;
.Superscript = &lt;span class=&quot;kw1&quot;&gt;False&lt;/span&gt;&lt;br&gt;
.Subscript = &lt;span class=&quot;kw1&quot;&gt;False&lt;/span&gt;&lt;br&gt;
.OutlineFont = &lt;span class=&quot;kw1&quot;&gt;False&lt;/span&gt;&lt;br&gt;
.Shadow = &lt;span class=&quot;kw1&quot;&gt;False&lt;/span&gt;&lt;br&gt;
.Underline = xlUnderlineStyleNone&lt;br&gt;
.ColorIndex = xlAutomatic&lt;br&gt;
&lt;span class=&quot;kw1&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;With&lt;/span&gt;&lt;br&gt;
ActiveSheet.Range(&lt;span class=&quot;st0&quot;&gt;&quot;A1&quot;&lt;/span&gt;).&lt;span class=&quot;kw1&quot;&gt;Select&lt;/span&gt;&lt;br&gt;
&lt;span class=&quot;kw1&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Sub&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;
</description>
		<content:encoded><![CDATA[<p>Sry, made a mistake at the button name. :p</p>
<div style="overflow: auto; white-space: nowrap;" class="codecolorer-container vb default">
<div style="white-space: nowrap;" class="vb codecolorer"><span class="kw1">Private</span> <span class="kw1">Sub</span> Main_Click()</p>
<p>Sheets.Add<br />
ActiveSheet.Buttons.Add(144, 38.25, 57, 21).<span class="kw1">Select</span><br />
Selection.OnAction = <span class="st0">&#8220;DisplayMessage&#8221;</span><br />
ActiveSheet.Shapes(<span class="st0">&#8220;Button 1&#8243;</span>).<span class="kw1">Select</span><br />
Selection.Characters.Text = <span class="st0">&#8220;Display Msg&#8221;</span><br />
<span class="kw1">With</span> Selection.Characters(Start:=1, Length:=11).Font<br />
.Name = <span class="st0">&#8220;Arial&#8221;</span><br />
.FontStyle = <span class="st0">&#8220;Regular&#8221;</span><br />
.Size = 10<br />
.Strikethrough = <span class="kw1">False</span><br />
.Superscript = <span class="kw1">False</span><br />
.Subscript = <span class="kw1">False</span><br />
.OutlineFont = <span class="kw1">False</span><br />
.Shadow = <span class="kw1">False</span><br />
.Underline = xlUnderlineStyleNone<br />
.ColorIndex = xlAutomatic<br />
<span class="kw1">End</span> <span class="kw1">With</span><br />
ActiveSheet.Range(<span class="st0">&#8220;A1&#8243;</span>).<span class="kw1">Select</span><br />
<span class="kw1">End</span> <span class="kw1">Sub</span></div>
</div>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rine</title>
		<link>http://www.dailydoseofexcel.com/archives/2004/06/03/passing-arguments-through-onaction/#comment-33788</link>
		<dc:creator>Rine</dc:creator>
		<pubDate>Wed, 23 Jul 2008 10:20:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=597#comment-33788</guid>
		<description>&lt;p&gt;Help Pls! &lt;/p&gt;
&lt;p&gt;I got the following msg when I tried running the second command button that is created together with the new sheet when i clicked on the first command button.&lt;/p&gt;
&lt;p&gt;&quot;The macro &#039;main.xls!DisplayMessage&#039; cannot be found&lt;/p&gt;
&lt;p&gt;I have extracted the following code:&lt;/p&gt;
&lt;div style=&quot;overflow: auto; white-space: nowrap;&quot; class=&quot;codecolorer-container vb default&quot;&gt;&lt;div style=&quot;white-space: nowrap;&quot; class=&quot;vb codecolorer&quot;&gt;&lt;span class=&quot;kw1&quot;&gt;Private&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Sub&lt;/span&gt; CommandButton1_Click()&lt;br&gt;
&lt;br&gt;
Sheets.Add&lt;br&gt;
ActiveSheet.Buttons.Add(144, 38.25, 57, 21).&lt;span class=&quot;kw1&quot;&gt;Select&lt;/span&gt;&lt;br&gt;
Selection.OnAction = &lt;span class=&quot;st0&quot;&gt;&quot;DisplayMessage&quot;&lt;/span&gt;&lt;br&gt;
ActiveSheet.Shapes(&lt;span class=&quot;st0&quot;&gt;&quot;Button 1&quot;&lt;/span&gt;).&lt;span class=&quot;kw1&quot;&gt;Select&lt;/span&gt;&lt;br&gt;
Selection.Characters.Text = &lt;span class=&quot;st0&quot;&gt;&quot;Display Msg&quot;&lt;/span&gt;&lt;br&gt;
&lt;span class=&quot;kw1&quot;&gt;With&lt;/span&gt; Selection.Characters(Start:=1, Length:=11).Font&lt;br&gt;
.Name = &lt;span class=&quot;st0&quot;&gt;&quot;Arial&quot;&lt;/span&gt;&lt;br&gt;
.FontStyle = &lt;span class=&quot;st0&quot;&gt;&quot;Regular&quot;&lt;/span&gt;&lt;br&gt;
.Size = 10&lt;br&gt;
.Strikethrough = &lt;span class=&quot;kw1&quot;&gt;False&lt;/span&gt;&lt;br&gt;
.Superscript = &lt;span class=&quot;kw1&quot;&gt;False&lt;/span&gt;&lt;br&gt;
.Subscript = &lt;span class=&quot;kw1&quot;&gt;False&lt;/span&gt;&lt;br&gt;
.OutlineFont = &lt;span class=&quot;kw1&quot;&gt;False&lt;/span&gt;&lt;br&gt;
.Shadow = &lt;span class=&quot;kw1&quot;&gt;False&lt;/span&gt;&lt;br&gt;
.Underline = xlUnderlineStyleNone&lt;br&gt;
.ColorIndex = xlAutomatic&lt;br&gt;
&lt;span class=&quot;kw1&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;With&lt;/span&gt;&lt;br&gt;
ActiveSheet.Range(&lt;span class=&quot;st0&quot;&gt;&quot;A1&quot;&lt;/span&gt;).&lt;span class=&quot;kw1&quot;&gt;Select&lt;/span&gt;&lt;br&gt;
&lt;span class=&quot;kw1&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Sub&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;I really wish to know what is the error that stoping it from executing the code.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Help Pls! </p>
<p>I got the following msg when I tried running the second command button that is created together with the new sheet when i clicked on the first command button.</p>
<p>&#8220;The macro &#8216;main.xls!DisplayMessage&#8217; cannot be found</p>
<p>I have extracted the following code:</p>
<div style="overflow: auto; white-space: nowrap;" class="codecolorer-container vb default">
<div style="white-space: nowrap;" class="vb codecolorer"><span class="kw1">Private</span> <span class="kw1">Sub</span> CommandButton1_Click()</p>
<p>Sheets.Add<br />
ActiveSheet.Buttons.Add(144, 38.25, 57, 21).<span class="kw1">Select</span><br />
Selection.OnAction = <span class="st0">&#8220;DisplayMessage&#8221;</span><br />
ActiveSheet.Shapes(<span class="st0">&#8220;Button 1&#8243;</span>).<span class="kw1">Select</span><br />
Selection.Characters.Text = <span class="st0">&#8220;Display Msg&#8221;</span><br />
<span class="kw1">With</span> Selection.Characters(Start:=1, Length:=11).Font<br />
.Name = <span class="st0">&#8220;Arial&#8221;</span><br />
.FontStyle = <span class="st0">&#8220;Regular&#8221;</span><br />
.Size = 10<br />
.Strikethrough = <span class="kw1">False</span><br />
.Superscript = <span class="kw1">False</span><br />
.Subscript = <span class="kw1">False</span><br />
.OutlineFont = <span class="kw1">False</span><br />
.Shadow = <span class="kw1">False</span><br />
.Underline = xlUnderlineStyleNone<br />
.ColorIndex = xlAutomatic<br />
<span class="kw1">End</span> <span class="kw1">With</span><br />
ActiveSheet.Range(<span class="st0">&#8220;A1&#8243;</span>).<span class="kw1">Select</span><br />
<span class="kw1">End</span> <span class="kw1">Sub</span></div>
</div>
<p>I really wish to know what is the error that stoping it from executing the code.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Amolin</title>
		<link>http://www.dailydoseofexcel.com/archives/2004/06/03/passing-arguments-through-onaction/#comment-31599</link>
		<dc:creator>Amolin</dc:creator>
		<pubDate>Tue, 01 Apr 2008 01:58:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=597#comment-31599</guid>
		<description>&lt;p&gt;Sheet1.Shapes(1).OnAction = &quot;&#039;&quot; &amp; &quot;ShowAnArgument &quot;&quot;&quot; &amp; sArg &amp; &quot;&quot;&quot;&#039;&quot;&lt;/p&gt;
&lt;p&gt;Can be replaced by:&lt;/p&gt;
&lt;p&gt;Sheet1.Shapes(1).OnAction = &quot;ShowAnArgument &quot;&quot;&quot; &amp; sArg &amp; &quot;&quot;&quot;&quot;&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Sheet1.Shapes(1).OnAction = &#8220;&#8216;&#8221; &amp; &#8220;ShowAnArgument &#8220;&#8221;" &amp; sArg &amp; &#8220;&#8221;"&#8216;&#8221;</p>
<p>Can be replaced by:</p>
<p>Sheet1.Shapes(1).OnAction = &#8220;ShowAnArgument &#8220;&#8221;" &amp; sArg &amp; &#8220;&#8221;"&#8221;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tim</title>
		<link>http://www.dailydoseofexcel.com/archives/2004/06/03/passing-arguments-through-onaction/#comment-31555</link>
		<dc:creator>Tim</dc:creator>
		<pubDate>Sun, 30 Mar 2008 06:31:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=597#comment-31555</guid>
		<description>&lt;p&gt;Interesting note... Excel doesn&#039;t like it if you are passing exclamation points.&lt;/p&gt;
&lt;p&gt;Example that works:&lt;br&gt;
   .OnAction = &quot;&#039;ShowParm &quot;&quot;x&quot;&quot;&#039;&quot;&lt;/p&gt;
&lt;p&gt;Example that doesn&#039;t:&lt;br&gt;
   .OnAction = &quot;&#039;ShowParm &quot;&quot;!&quot;&quot;&#039;&quot;&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Interesting note&#8230; Excel doesn&#8217;t like it if you are passing exclamation points.</p>
<p>Example that works:<br />
   .OnAction = &#8220;&#8216;ShowParm &#8220;&#8221;x&#8221;"&#8216;&#8221;</p>
<p>Example that doesn&#8217;t:<br />
   .OnAction = &#8220;&#8216;ShowParm &#8220;&#8221;!&#8221;"&#8216;&#8221;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tushar Mehta</title>
		<link>http://www.dailydoseofexcel.com/archives/2004/06/03/passing-arguments-through-onaction/#comment-27473</link>
		<dc:creator>Tushar Mehta</dc:creator>
		<pubDate>Tue, 18 Sep 2007 13:05:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=597#comment-27473</guid>
		<description>&lt;p&gt;Mcfly: I don&#039;t understand what you mean by the macro must be located in a module since every sub/function must be in some kind of a module.&lt;/p&gt;
&lt;p&gt;Also, in a test with 2007 a few minutes ago, I did not have to specify the module name as you apparently had to.  Typically, that is required only when one has routines with the same name in different modules.  And, that need to uniquely specify which routine one means has always been the case.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Mcfly: I don&#8217;t understand what you mean by the macro must be located in a module since every sub/function must be in some kind of a module.</p>
<p>Also, in a test with 2007 a few minutes ago, I did not have to specify the module name as you apparently had to.  Typically, that is required only when one has routines with the same name in different modules.  And, that need to uniquely specify which routine one means has always been the case.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

