<?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: VBA Change Sheet Size in Inventor Programming Forum</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-forum/vba-change-sheet-size/m-p/5325645#M134261</link>
    <description>&lt;P&gt;Vladimir,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a way to remove unused sheet sizes from this list? We have some that we do not use and wanted to explore removing them. We are using Inventor 2015 PDS.&lt;/P&gt;&lt;P&gt;&lt;IMG title="image.jpg" border="0" src="https://forums.autodesk.com/t5/image/serverpage/image-id/131233i7ED502CE8C96C17D/image-size/original?v=mpbl-1&amp;amp;px=-1" align="middle" alt="image.jpg" /&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 08 Oct 2014 17:58:39 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2014-10-08T17:58:39Z</dc:date>
    <item>
      <title>VBA Change Sheet Size</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/vba-change-sheet-size/m-p/3637570#M134259</link>
      <description>&lt;P&gt;I am having an issue with changing sheet sizes using VBA. Due to the constraints under which my borders and title blocks were created, inventor forces me to delete the current border before changing the sheet size. I have 5 different borders and 2 title blocks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;-Borders&lt;BR /&gt;"A0 Border (13x8 Zone)"&lt;BR /&gt;"A1 Border (8x6 Zone)"&lt;BR /&gt;"A2 Border (6x4 Zone)"&lt;BR /&gt;"A3 Border (4x3 Zone)"&lt;BR /&gt;"A4 Border (No Zones)"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;-Title Blocks&lt;BR /&gt;Title Block 1 - All sizes except for A4&lt;BR /&gt;Title Block 2 - A4 Only&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I have a good idea of what I need to do, but I'm having trouble changing the sheet size. This is the extent of the code that I know actually works:&lt;/P&gt;&lt;P&gt;Thanks for the help!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Option Explicit

Private oDoc As DrawingDocument
Private oSheet As Sheet
Private oBorderDef As BorderDefinition
Private oBorder As Border

Set oDoc = ThisApplication.ActiveDocument
Set oSheet = oDoc.ActiveSheet
Set oBorderDef = oDoc.BorderDefinitions.Item("A0 Border (13x8 Zone)")

Private Sub UserForm_Initialize()
    cmbPageSize.AddItem ("A0")
    cmbPageSize.AddItem ("A1")
    cmbPageSize.AddItem ("A2")
    cmbPageSize.AddItem ("A3")
    cmbPageSize.AddItem ("A4")
End Sub

Private Sub cmbPageSize_Change()
    Select Case cmbPageSize.Value
        Case "A0"
            MsgBox ("A0")

     'Delete Existing Border
     oSheet.Border.Delete

     'Delete Existing Title Block

     'Change Sheet Size To A0

     'Place Border "A0 Border (13x8 Zone)"

     'Place Title Block "1"

        Case "A1"
            MsgBox ("A1")

     'Delete Existing Border
     oSheet.Border.Delete

     'Delete Existing Title Block

     'Change Sheet Size To A1

     'Place Border "A1 Border (8x6 Zone)"

     'Place Title Block "1"

        Case "A2"
            MsgBox ("A2")

     'Delete Existing Border
     oSheet.Border.Delete

     'Delete Existing Title Block

     'Change Sheet Size To A2

     'Place Border "A2 Border (6x4 Zone)"

     'Place Title Block "1"

        Case "A3"
     MsgBox ("A3")

     'Delete Existing Border
     oSheet.Border.Delete

     'Delete Existing Title Block

     'Change Sheet Size To A3

     'Place Border "A3 Border (4x3 Zone)"

     'Place Title Block "1"

        Case "A4"
            MsgBox ("A4")

     'Delete Existing Border
     oSheet.Border.Delete

     'Delete Existing Title Block

     'Change Sheet Size To A4

     'Place Border "A4 Border (No Zones)"

     'Place Title Block "2"

    End Select
End Sub

&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Sep 2012 20:00:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/vba-change-sheet-size/m-p/3637570#M134259</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-09-27T20:00:27Z</dc:date>
    </item>
    <item>
      <title>Re: VBA Change Sheet Size</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/vba-change-sheet-size/m-p/3654442#M134260</link>
      <description>&lt;P&gt;Sheet size is controlled by Sheet.Size property.&lt;/P&gt;
&lt;P&gt;Please try this sample code.&lt;/P&gt;
&lt;PRE&gt;Private Sub ChangeSheetSize()

  Dim oDoc As DrawingDocument
  Set oDoc = ThisApplication.ActiveDocument
  
  Dim oSheet As Sheet
  Set oSheet = oDoc.ActiveSheet
  
  'get current size
  Dim Size As DrawingSheetSizeEnum
  Size = oSheet.Size
  
  'set new size
  oSheet.Size = DrawingSheetSizeEnum.kA0DrawingSheetSize
  
  'update sheet to see results
  oSheet.Update
  
End Sub 'ChangeSheetSize&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;Cheers&lt;/P&gt;</description>
      <pubDate>Wed, 10 Oct 2012 19:57:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/vba-change-sheet-size/m-p/3654442#M134260</guid>
      <dc:creator>Vladimir.Ananyev</dc:creator>
      <dc:date>2012-10-10T19:57:29Z</dc:date>
    </item>
    <item>
      <title>Re: VBA Change Sheet Size</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/vba-change-sheet-size/m-p/5325645#M134261</link>
      <description>&lt;P&gt;Vladimir,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a way to remove unused sheet sizes from this list? We have some that we do not use and wanted to explore removing them. We are using Inventor 2015 PDS.&lt;/P&gt;&lt;P&gt;&lt;IMG title="image.jpg" border="0" src="https://forums.autodesk.com/t5/image/serverpage/image-id/131233i7ED502CE8C96C17D/image-size/original?v=mpbl-1&amp;amp;px=-1" align="middle" alt="image.jpg" /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Oct 2014 17:58:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/vba-change-sheet-size/m-p/5325645#M134261</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-10-08T17:58:39Z</dc:date>
    </item>
  </channel>
</rss>

