<?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: Error: Object Variable or With block variable not set in Inventor Programming Forum</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-forum/error-object-variable-or-with-block-variable-not-set/m-p/9117065#M70118</link>
    <description>&lt;P&gt;Thank you for your reply.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The value of&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;BORDERNAME&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;Parameter&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;KINZEBORDER&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt; &lt;/PRE&gt;&lt;P&gt;is a multi value parameter with values of "KASSEMBLY", "KPART", "KGANGPART" AND "KGANGASSEMBLY".&lt;/P&gt;&lt;P&gt;I'm sorry it crashed your inventor session. I am using Inventor 2016. This code was given to me by Autodesk Help to work around the problem of using the&amp;nbsp;&amp;nbsp;&lt;SPAN&gt;ActiveSheet.Border = Parameter ("KINZEBORDER") code which was setting border zones to value =0 and not displaying. This code was to simulate actually hitting the browser button to delete existing border and add the desired border.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I will try your suggestion and let you know how it works.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;BR /&gt;Raj&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 30 Oct 2019 13:09:16 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2019-10-30T13:09:16Z</dc:date>
    <item>
      <title>Error: Object Variable or With block variable not set</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/error-object-variable-or-with-block-variable-not-set/m-p/9115587#M70115</link>
      <description>&lt;P&gt;Please help. With this iLogic rule run as external rule, I am intermittently getting the error: Object Variable or With block variable not set with the codes below:&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;Sub&lt;/SPAN&gt; &lt;SPAN&gt;Main&lt;/SPAN&gt;&lt;SPAN&gt;()&lt;/SPAN&gt;
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oDoc&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;Document&lt;/SPAN&gt;
&lt;SPAN&gt;oDoc&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;ThisDoc&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;Document&lt;/SPAN&gt;

Dim BORDERNAME as String
&lt;SPAN&gt;BORDERNAME&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;Parameter&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;KINZEBORDER&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt; 
    &lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;cd&lt;/SPAN&gt;
    &lt;SPAN&gt;cd&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;ThisApplication&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;CommandManager&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;S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N&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;
    &lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;node&lt;/SPAN&gt;
    &lt;SPAN&gt;For&lt;/SPAN&gt; &lt;SPAN&gt;Each&lt;/SPAN&gt; &lt;SPAN&gt;node&lt;/SPAN&gt; &lt;SPAN&gt;In&lt;/SPAN&gt; &lt;SPAN&gt;nodes&lt;/SPAN&gt;
        &lt;SPAN&gt;If&lt;/SPAN&gt; &lt;SPAN&gt;name&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;node&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;BrowserNodeDefinition&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;Label&lt;/SPAN&gt; &lt;SPAN&gt;Then&lt;/SPAN&gt;
            &lt;SPAN&gt;FindBorderNode&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;node&lt;/SPAN&gt;
            &lt;SPAN&gt;Exit Function&lt;/SPAN&gt;
        &lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;If&lt;/SPAN&gt;
    
        &lt;SPAN&gt;FindBorderNode&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;FindBorderNode&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;name&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;node&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;BrowserNodes&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;
        &lt;SPAN&gt;If&lt;/SPAN&gt; &lt;SPAN&gt;Not&lt;/SPAN&gt; &lt;SPAN&gt;FindBorderNode&lt;/SPAN&gt; &lt;SPAN&gt;Is&lt;/SPAN&gt; &lt;SPAN&gt;Nothing&lt;/SPAN&gt; &lt;SPAN&gt;Then&lt;/SPAN&gt;
            &lt;SPAN&gt;Exit Function&lt;/SPAN&gt;
        &lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;If&lt;/SPAN&gt;
    &lt;SPAN&gt;Next&lt;/SPAN&gt;
&lt;SPAN&gt;End Function&lt;/SPAN&gt;
&lt;/PRE&gt;&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;</description>
      <pubDate>Tue, 29 Oct 2019 19:15:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/error-object-variable-or-with-block-variable-not-set/m-p/9115587#M70115</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-10-29T19:15:36Z</dc:date>
    </item>
    <item>
      <title>Re: Error: Object Variable or With block variable not set</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/error-object-variable-or-with-block-variable-not-set/m-p/9116668#M70116</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What is the value of "&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;BORDERNAME&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;Parameter&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;KINZEBORDER&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt; &lt;/PRE&gt;&lt;P&gt;"&lt;/P&gt;</description>
      <pubDate>Wed, 30 Oct 2019 10:27:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/error-object-variable-or-with-block-variable-not-set/m-p/9116668#M70116</guid>
      <dc:creator>bradeneuropeArthur</dc:creator>
      <dc:date>2019-10-30T10:27:19Z</dc:date>
    </item>
    <item>
      <title>Re: Error: Object Variable or With block variable not set</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/error-object-variable-or-with-block-variable-not-set/m-p/9116912#M70117</link>
      <description>&lt;P&gt;Hi, when i tryed your script it made inventor crash. Also i see a couple of things i dont understand. Anyway i think you try to set a border by a parameter. You could try this script.&lt;/P&gt;&lt;PRE&gt;Dim oDrawDoc As DrawingDocument = ThisApplication.ActiveDocument
Dim oSheet As Sheet = oDrawDoc.ActiveSheet
Dim oBorder As Border = oSheet.Border
oBorder.Delete()
Dim borderName As String = KINZEBORDER

If (borderName = "Default Border") Then
    oSheet.AddDefaultBorder()
Else
    Dim oBorderDef As BorderDefinition = oDrawDoc.BorderDefinitions.Item(borderName)
    oSheet.AddBorder(oBorderDef)
End If&lt;/PRE&gt;&lt;P&gt;in this script i expect the default border is called "Default Border". That could be different in your language. if so you need to set it correct in the script.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Oct 2019 12:22:12 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/error-object-variable-or-with-block-variable-not-set/m-p/9116912#M70117</guid>
      <dc:creator>JelteDeJong</dc:creator>
      <dc:date>2019-10-30T12:22:12Z</dc:date>
    </item>
    <item>
      <title>Re: Error: Object Variable or With block variable not set</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/error-object-variable-or-with-block-variable-not-set/m-p/9117065#M70118</link>
      <description>&lt;P&gt;Thank you for your reply.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The value of&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;BORDERNAME&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;Parameter&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;KINZEBORDER&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt; &lt;/PRE&gt;&lt;P&gt;is a multi value parameter with values of "KASSEMBLY", "KPART", "KGANGPART" AND "KGANGASSEMBLY".&lt;/P&gt;&lt;P&gt;I'm sorry it crashed your inventor session. I am using Inventor 2016. This code was given to me by Autodesk Help to work around the problem of using the&amp;nbsp;&amp;nbsp;&lt;SPAN&gt;ActiveSheet.Border = Parameter ("KINZEBORDER") code which was setting border zones to value =0 and not displaying. This code was to simulate actually hitting the browser button to delete existing border and add the desired border.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I will try your suggestion and let you know how it works.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;BR /&gt;Raj&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 30 Oct 2019 13:09:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/error-object-variable-or-with-block-variable-not-set/m-p/9117065#M70118</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-10-30T13:09:16Z</dc:date>
    </item>
    <item>
      <title>Re: Error: Object Variable or With block variable not set</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/error-object-variable-or-with-block-variable-not-set/m-p/9123062#M70119</link>
      <description>&lt;P&gt;Unfortunately, the code provided by Jelte De Jong works but has the problem with border zones turning off. This is the same issue as using the "ActiveSheet.Border="NameofBorder"". Zones disappear when the border is placed into the drawing sheet.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;With the codes for expanding the browser node and simulating the click even gives "Object variable or With block variable not set" error constantly.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 01 Nov 2019 23:58:12 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/error-object-variable-or-with-block-variable-not-set/m-p/9123062#M70119</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-11-01T23:58:12Z</dc:date>
    </item>
  </channel>
</rss>

