<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Issue with InputBox Cancel Button in Inventor Programming Forum</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-forum/issue-with-inputbox-cancel-button/m-p/11210682#M36362</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1954827"&gt;@bbrumfield&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;With iLogic, you can put the inputbox in a try/catch to handle the cancel button.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I hope this helps.&lt;BR /&gt;Best of luck to you in all of your Inventor pursuits,&lt;BR /&gt;Curtis&lt;BR /&gt;&lt;A href="http://inventortrenches.blogspot.com" target="_blank"&gt;http://inventortrenches.blogspot.com&lt;/A&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;dSheetWidth&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;Double&lt;/SPAN&gt;
&lt;SPAN&gt;Try&lt;/SPAN&gt;
	&lt;SPAN&gt;dSheetWidth&lt;/SPAN&gt; = &lt;SPAN&gt;CInt&lt;/SPAN&gt;(&lt;SPAN&gt;InputBox&lt;/SPAN&gt;(&lt;SPAN&gt;"Enter Material Width (Value Required)"&lt;/SPAN&gt;, &lt;SPAN&gt;"Sheet Width"&lt;/SPAN&gt;, 0.00))
&lt;SPAN&gt;Catch&lt;/SPAN&gt;
	&lt;SPAN&gt;dSheetWidth&lt;/SPAN&gt; = 0
&lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;Try&lt;/SPAN&gt;

&lt;SPAN&gt;If&lt;/SPAN&gt; &lt;SPAN&gt;dSheetWidth&lt;/SPAN&gt; = 0 
	&lt;SPAN&gt;MessageBox&lt;/SPAN&gt;.&lt;SPAN&gt;Show&lt;/SPAN&gt;(&lt;SPAN&gt;"You Must Enter A Sheet Width"&lt;/SPAN&gt;)

	&lt;SPAN&gt;GoTo&lt;/SPAN&gt; &lt;SPAN&gt;Width&lt;/SPAN&gt;
&lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;If&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 02 Jun 2022 14:21:53 GMT</pubDate>
    <dc:creator>Curtis_W</dc:creator>
    <dc:date>2022-06-02T14:21:53Z</dc:date>
    <item>
      <title>Issue with InputBox Cancel Button</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/issue-with-inputbox-cancel-button/m-p/11209232#M36360</link>
      <description>&lt;P&gt;Any Help would be appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Trying to clean up some code so that if the user Hits the cancel button rather than inputting a number they will get bounced back to the start, If they were to leave the text field zero the rule below works but if they cancel there is an error :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="bbrumfield_0-1654130464862.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1075039iECDC137238B1026C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="bbrumfield_0-1654130464862.png" alt="bbrumfield_0-1654130464862.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;Width&lt;/SPAN&gt; :

&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;dSheetWidth&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;Double&lt;/SPAN&gt; = &lt;SPAN&gt;CInt&lt;/SPAN&gt;(&lt;SPAN&gt;InputBox&lt;/SPAN&gt;(&lt;SPAN&gt;"Enter Material Width (Value Required)"&lt;/SPAN&gt;, &lt;SPAN&gt;"Sheet Width"&lt;/SPAN&gt;, 0.00))

&lt;SPAN&gt;If&lt;/SPAN&gt; &lt;SPAN&gt;dSheetWidth&lt;/SPAN&gt; = 0 &lt;SPAN&gt;Or&lt;/SPAN&gt; &lt;SPAN&gt;Nothing&lt;/SPAN&gt;
	
	&lt;SPAN&gt;MessageBox&lt;/SPAN&gt;.&lt;SPAN&gt;Show&lt;/SPAN&gt;(&lt;SPAN&gt;"You Must Enter A Sheet Width"&lt;/SPAN&gt;)
	
	&lt;SPAN&gt;GoTo&lt;/SPAN&gt; &lt;SPAN&gt;Width&lt;/SPAN&gt;
	
&lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;If&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;Thanks,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Brent&lt;/P&gt;</description>
      <pubDate>Thu, 02 Jun 2022 00:43:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/issue-with-inputbox-cancel-button/m-p/11209232#M36360</guid>
      <dc:creator>bbrumfield</dc:creator>
      <dc:date>2022-06-02T00:43:29Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with InputBox Cancel Button</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/issue-with-inputbox-cancel-button/m-p/11209468#M36361</link>
      <description>&lt;P&gt;This was a little trickier than expected but these two samples seem to work. The cancel and close buttons have a string value where as you have declared a double value. Sample 1 sends the string error to a double value which luckily you don't need to use a value of 0.&amp;nbsp;&lt;SPAN&gt;Sample 2 handles the string values first then the double values.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is a link to &lt;A href="https://stackoverflow.com/questions/48193849/vba-input-box-cancel-and-variable-setting" target="_blank" rel="noopener"&gt;sample1&lt;/A&gt;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;Width&lt;/SPAN&gt; :

&lt;SPAN&gt;On&lt;/SPAN&gt; &lt;SPAN&gt;Error&lt;/SPAN&gt; &lt;SPAN&gt;Resume&lt;/SPAN&gt; &lt;SPAN&gt;Next&lt;/SPAN&gt;
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;dSheetWidth&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;Double&lt;/SPAN&gt; = &lt;SPAN&gt;CInt&lt;/SPAN&gt;(&lt;SPAN&gt;InputBox&lt;/SPAN&gt;(&lt;SPAN&gt;"Enter Material Width (Value Required)"&lt;/SPAN&gt;, &lt;SPAN&gt;"Sheet Width"&lt;/SPAN&gt;, 0.00))
&lt;SPAN&gt;On&lt;/SPAN&gt; &lt;SPAN&gt;Error&lt;/SPAN&gt; &lt;SPAN&gt;GoTo&lt;/SPAN&gt; 0 &lt;SPAN&gt;'Error handling&lt;/SPAN&gt;

&lt;SPAN&gt;If&lt;/SPAN&gt; &lt;SPAN&gt;dSheetWidth&lt;/SPAN&gt; = 0 &lt;SPAN&gt;Then&lt;/SPAN&gt; &lt;SPAN&gt;GoTo&lt;/SPAN&gt; &lt;SPAN&gt;Width&lt;/SPAN&gt;
	&lt;SPAN&gt;MessageBox&lt;/SPAN&gt;.&lt;SPAN&gt;Show&lt;/SPAN&gt;(&lt;SPAN&gt;dSheetWidth&lt;/SPAN&gt;, &lt;SPAN&gt;"Success"&lt;/SPAN&gt;)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is a link to &lt;A href="https://stackoverflow.com/questions/55050473/determining-if-cancel-button-pressed-where-inputbox-variable-declared-as-double" target="_blank" rel="noopener"&gt;sample&lt;/A&gt;2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;	

&lt;SPAN&gt;Width&lt;/SPAN&gt; :
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;dSheetWidth&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;Double&lt;/SPAN&gt;
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;sSheetWidth&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;String&lt;/SPAN&gt; = &lt;SPAN&gt;InputBox&lt;/SPAN&gt;(&lt;SPAN&gt;"Enter Material Width (Value Required)"&lt;/SPAN&gt;, &lt;SPAN&gt;"Sheet Width"&lt;/SPAN&gt;, 0.00)
	
&lt;SPAN&gt;If&lt;/SPAN&gt; &lt;SPAN&gt;sSheetWidth&lt;/SPAN&gt; = &lt;SPAN&gt;vbNullString&lt;/SPAN&gt; &lt;SPAN&gt;Then&lt;/SPAN&gt; : &lt;SPAN&gt;GoTo&lt;/SPAN&gt; &lt;SPAN&gt;Width&lt;/SPAN&gt; &lt;SPAN&gt;'Deal with cancel/close button&lt;/SPAN&gt;
&lt;SPAN&gt;ElseIf&lt;/SPAN&gt; &lt;SPAN&gt;sSheetWidth&lt;/SPAN&gt; &amp;lt;&amp;gt; &lt;SPAN&gt;vbNullString&lt;/SPAN&gt; &lt;SPAN&gt;And&lt;/SPAN&gt; &lt;SPAN&gt;Not&lt;/SPAN&gt; &lt;SPAN&gt;IsNumeric&lt;/SPAN&gt;(&lt;SPAN&gt;sSheetWidth&lt;/SPAN&gt;)&lt;SPAN&gt;Then&lt;/SPAN&gt; : &lt;SPAN&gt;GoTo&lt;/SPAN&gt; &lt;SPAN&gt;Width&lt;/SPAN&gt; &lt;SPAN&gt;'Deal with non numeric values&lt;/SPAN&gt;
&lt;SPAN&gt;ElseIf&lt;/SPAN&gt; &lt;SPAN&gt;sSheetWidth&lt;/SPAN&gt; &amp;lt;&amp;gt; &lt;SPAN&gt;vbNullString&lt;/SPAN&gt; &lt;SPAN&gt;And&lt;/SPAN&gt; &lt;SPAN&gt;IsNumeric&lt;/SPAN&gt;(&lt;SPAN&gt;sSheetWidth&lt;/SPAN&gt;)&lt;SPAN&gt;Then&lt;/SPAN&gt; &lt;SPAN&gt;'Is a valid double entry &lt;/SPAN&gt;
	&lt;SPAN&gt;dSheetWidth&lt;/SPAN&gt; = &lt;SPAN&gt;CInt&lt;/SPAN&gt;(&lt;SPAN&gt;sSheetWidth&lt;/SPAN&gt;)
	&lt;SPAN&gt;If&lt;/SPAN&gt; &lt;SPAN&gt;dSheetWidth&lt;/SPAN&gt; = 0 &lt;SPAN&gt;Then&lt;/SPAN&gt; : &lt;SPAN&gt;GoTo&lt;/SPAN&gt; &lt;SPAN&gt;Width&lt;/SPAN&gt;
	&lt;SPAN&gt;Else&lt;/SPAN&gt;
		&lt;SPAN&gt;MessageBox&lt;/SPAN&gt;.&lt;SPAN&gt;Show&lt;/SPAN&gt;(&lt;SPAN&gt;dSheetWidth, "Success"&lt;/SPAN&gt;)
	&lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;If&lt;/SPAN&gt;
&lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;If&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Jun 2022 03:48:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/issue-with-inputbox-cancel-button/m-p/11209468#M36361</guid>
      <dc:creator>A.Acheson</dc:creator>
      <dc:date>2022-06-02T03:48:44Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with InputBox Cancel Button</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/issue-with-inputbox-cancel-button/m-p/11210682#M36362</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1954827"&gt;@bbrumfield&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;With iLogic, you can put the inputbox in a try/catch to handle the cancel button.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I hope this helps.&lt;BR /&gt;Best of luck to you in all of your Inventor pursuits,&lt;BR /&gt;Curtis&lt;BR /&gt;&lt;A href="http://inventortrenches.blogspot.com" target="_blank"&gt;http://inventortrenches.blogspot.com&lt;/A&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;dSheetWidth&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;Double&lt;/SPAN&gt;
&lt;SPAN&gt;Try&lt;/SPAN&gt;
	&lt;SPAN&gt;dSheetWidth&lt;/SPAN&gt; = &lt;SPAN&gt;CInt&lt;/SPAN&gt;(&lt;SPAN&gt;InputBox&lt;/SPAN&gt;(&lt;SPAN&gt;"Enter Material Width (Value Required)"&lt;/SPAN&gt;, &lt;SPAN&gt;"Sheet Width"&lt;/SPAN&gt;, 0.00))
&lt;SPAN&gt;Catch&lt;/SPAN&gt;
	&lt;SPAN&gt;dSheetWidth&lt;/SPAN&gt; = 0
&lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;Try&lt;/SPAN&gt;

&lt;SPAN&gt;If&lt;/SPAN&gt; &lt;SPAN&gt;dSheetWidth&lt;/SPAN&gt; = 0 
	&lt;SPAN&gt;MessageBox&lt;/SPAN&gt;.&lt;SPAN&gt;Show&lt;/SPAN&gt;(&lt;SPAN&gt;"You Must Enter A Sheet Width"&lt;/SPAN&gt;)

	&lt;SPAN&gt;GoTo&lt;/SPAN&gt; &lt;SPAN&gt;Width&lt;/SPAN&gt;
&lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;If&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Jun 2022 14:21:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/issue-with-inputbox-cancel-button/m-p/11210682#M36362</guid>
      <dc:creator>Curtis_W</dc:creator>
      <dc:date>2022-06-02T14:21:53Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with InputBox Cancel Button</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/issue-with-inputbox-cancel-button/m-p/11210794#M36363</link>
      <description>&lt;P&gt;Hi Curtis,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you! This has solved the Cancel button issue.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Brent&lt;/P&gt;</description>
      <pubDate>Thu, 02 Jun 2022 15:10:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/issue-with-inputbox-cancel-button/m-p/11210794#M36363</guid>
      <dc:creator>bbrumfield</dc:creator>
      <dc:date>2022-06-02T15:10:16Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with InputBox Cancel Button</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/issue-with-inputbox-cancel-button/m-p/11210802#M36364</link>
      <description>&lt;P&gt;Hi A.Acheson,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you! Both examples work without error.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Brent&lt;/P&gt;</description>
      <pubDate>Thu, 02 Jun 2022 15:12:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/issue-with-inputbox-cancel-button/m-p/11210802#M36364</guid>
      <dc:creator>bbrumfield</dc:creator>
      <dc:date>2022-06-02T15:12:11Z</dc:date>
    </item>
  </channel>
</rss>

