<?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 in inserting Border into drawing through userform in Inventor Programming - iLogic, Macros, AddIns &amp; Apprentice</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/error-in-inserting-border-into-drawing-through-userform/m-p/10394570#M125519</link>
    <description>&lt;P&gt;According to the help page the AddBorder() function takes 2 arguments.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JelteDeJong_0-1623842995468.png" style="width: 776px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/930963i56619621659817A2/image-size/large?v=v2&amp;amp;px=999" role="button" title="JelteDeJong_0-1623842995468.png" alt="JelteDeJong_0-1623842995468.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;In your code i see 3:&lt;/P&gt;&lt;LI-CODE lang="general"&gt;                                   1      2        3
Set oBorder = oSheet.AddBorder(oBorderDef, , sPromptStrings)&lt;/LI-CODE&gt;&lt;P&gt;you could try:&lt;/P&gt;&lt;LI-CODE lang="general"&gt;Set oBorder = oSheet.AddBorder(oBorderDef, sPromptStrings)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 16 Jun 2021 11:32:06 GMT</pubDate>
    <dc:creator>JelteDeJong</dc:creator>
    <dc:date>2021-06-16T11:32:06Z</dc:date>
    <item>
      <title>Error in inserting Border into drawing through userform</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/error-in-inserting-border-into-drawing-through-userform/m-p/10394237#M125515</link>
      <description>&lt;P&gt;Hello, still coming to grips with VBA, but managed to use the same code below to insert various title blocks through a userform. I have separated the code now to just generate on the click of a button to test out inserting a drawing border. I don't seem to be able to correct the errors in the code that are giving me a 'wrong number of arguments or invalid property assignment' while highlighting the oSheet.AddBorder at the end of the code. If anyone has any ideas how to fix I would highly appreciate this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;Sub GenerateButton_Click()
    
    'Get the active document.
    Dim oDrawDoc As Document
    Set oDrawDoc = ThisApplication.ActiveDocument

    'Get the PropertySets object.
    Dim oPropSets As PropertySets
    Set oPropSets = oDrawDoc.PropertySets
    
    ' Obtain a reference to the desired border defintion.
    Dim oBorderDef As BorderDefinition
    Set oBorderDef = oDrawDoc.BorderDefinitions.Item("Default Border")

    Dim oSheet As Sheet
    Set oSheet = oDrawDoc.ActiveSheet

    ' Check to see if the sheet already has a border and delete it if it does.
    If Not oSheet.Border Is Nothing Then
        oSheet.Border.Delete
    End If

    Dim sPromptStrings(1 To 2) As String
    sPromptStrings(1) = "String 1"
    sPromptStrings(2) = "String 2"

    ' Add an instance of the border definition to the sheet.
    Dim oBorder As Border
    Set oBorder = oSheet.AddBorder(oBorderDef, , sPromptStrings)
    
    Unload Me

End Sub&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 16 Jun 2021 08:54:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/error-in-inserting-border-into-drawing-through-userform/m-p/10394237#M125515</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-06-16T08:54:52Z</dc:date>
    </item>
    <item>
      <title>Re: Error in inserting Border into drawing through userform</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/error-in-inserting-border-into-drawing-through-userform/m-p/10394570#M125519</link>
      <description>&lt;P&gt;According to the help page the AddBorder() function takes 2 arguments.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JelteDeJong_0-1623842995468.png" style="width: 776px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/930963i56619621659817A2/image-size/large?v=v2&amp;amp;px=999" role="button" title="JelteDeJong_0-1623842995468.png" alt="JelteDeJong_0-1623842995468.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;In your code i see 3:&lt;/P&gt;&lt;LI-CODE lang="general"&gt;                                   1      2        3
Set oBorder = oSheet.AddBorder(oBorderDef, , sPromptStrings)&lt;/LI-CODE&gt;&lt;P&gt;you could try:&lt;/P&gt;&lt;LI-CODE lang="general"&gt;Set oBorder = oSheet.AddBorder(oBorderDef, sPromptStrings)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Jun 2021 11:32:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/error-in-inserting-border-into-drawing-through-userform/m-p/10394570#M125519</guid>
      <dc:creator>JelteDeJong</dc:creator>
      <dc:date>2021-06-16T11:32:06Z</dc:date>
    </item>
    <item>
      <title>Re: Error in inserting Border into drawing through userform</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/error-in-inserting-border-into-drawing-through-userform/m-p/10394628#M125520</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/5011186"&gt;@JelteDeJong&lt;/a&gt;&amp;nbsp; Fantastic, that was it! Thank you very much for your quick response. Good reminder to also consult the help page thoroughly. Have marked it as solution accepted.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kind Regards,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Joao&lt;/P&gt;</description>
      <pubDate>Wed, 16 Jun 2021 11:50:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/error-in-inserting-border-into-drawing-through-userform/m-p/10394628#M125520</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-06-16T11:50:23Z</dc:date>
    </item>
  </channel>
</rss>

