<?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: Open a iam file with excel VBA in Inventor Programming - iLogic, Macros, AddIns &amp; Apprentice</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/open-a-iam-file-with-excel-vba/m-p/6436492#M65476</link>
    <description>&lt;P&gt;Hi Alex,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In Excel VBA first reference the Inventor Object Library:&lt;/P&gt;
&lt;P&gt;&lt;IMG title="VBA_References.jpg" alt="VBA_References.jpg" src="https://forums.autodesk.com/t5/image/serverpage/image-id/255213iCAED2DB7C5C298C8/image-size/original?v=v2&amp;amp;px=-1" border="0" /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then use&amp;nbsp;GetObject or CreateObject to connect to a running session of Inventor or create a new session.&amp;nbsp; This post has an example:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://forums.autodesk.com/t5/inventor-customization/getobject-need-help/m-p/759841/highlight/true#M3523" target="_blank"&gt;http://forums.autodesk.com/t5/inventor-customization/getobject-need-help/m-p/759841/highlight/true#M3523&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Once you have the Inventor Application object you can use the Open method of the Documents collection. Below is an Inventor&amp;nbsp;VBA example from the help file.&amp;nbsp;It shows how to&amp;nbsp;open an assembly with a level of detail. You could just change it&amp;nbsp;and pass in the path to your assembly. &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;Public Sub OpenDocumentInLastActiveLOD()
    Dim strFullFileName As String
    strFullFileName = "C:\temp\Assembly1.iam"
    
    ' Set a reference to the FileManager object.
    Dim oFileManager As FileManager
    Set oFileManager = ThisApplication.FileManager
    
    ' Get the name of the last active Level of Detail (LOD) Representation.
    Dim strLastActiveLOD As String
    strLastActiveLOD = oFileManager.GetLastActiveLevelOfDetailRepresentation(strFullFileName)
    
    ' Use the full file name and LOD name to get the full document name.
    Dim strFullDocumentName As String
    strFullDocumentName = oFileManager.GetFullDocumentName(strFullFileName, strLastActiveLOD)
    
    ' Open the document in the last active LOD.
    Dim oDoc As AssemblyDocument
    Set oDoc = ThisApplication.Documents.Open(strFullDocumentName)
End Sub
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Wayne&lt;/P&gt;</description>
    <pubDate>Thu, 14 Jul 2016 16:47:52 GMT</pubDate>
    <dc:creator>wayne.brill</dc:creator>
    <dc:date>2016-07-14T16:47:52Z</dc:date>
    <item>
      <title>Open a iam file with excel VBA</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/open-a-iam-file-with-excel-vba/m-p/6436025#M65473</link>
      <description>&lt;P&gt;Hello there&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;is there a way to open a inventor file (.iam) with excel VBA?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I use a path!!!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Alex&lt;/P&gt;</description>
      <pubDate>Thu, 14 Jul 2016 13:38:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/open-a-iam-file-with-excel-vba/m-p/6436025#M65473</guid>
      <dc:creator>Fieger</dc:creator>
      <dc:date>2016-07-14T13:38:57Z</dc:date>
    </item>
    <item>
      <title>Re: Open a iam file with excel VBA</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/open-a-iam-file-with-excel-vba/m-p/6436492#M65476</link>
      <description>&lt;P&gt;Hi Alex,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In Excel VBA first reference the Inventor Object Library:&lt;/P&gt;
&lt;P&gt;&lt;IMG title="VBA_References.jpg" alt="VBA_References.jpg" src="https://forums.autodesk.com/t5/image/serverpage/image-id/255213iCAED2DB7C5C298C8/image-size/original?v=v2&amp;amp;px=-1" border="0" /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then use&amp;nbsp;GetObject or CreateObject to connect to a running session of Inventor or create a new session.&amp;nbsp; This post has an example:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://forums.autodesk.com/t5/inventor-customization/getobject-need-help/m-p/759841/highlight/true#M3523" target="_blank"&gt;http://forums.autodesk.com/t5/inventor-customization/getobject-need-help/m-p/759841/highlight/true#M3523&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Once you have the Inventor Application object you can use the Open method of the Documents collection. Below is an Inventor&amp;nbsp;VBA example from the help file.&amp;nbsp;It shows how to&amp;nbsp;open an assembly with a level of detail. You could just change it&amp;nbsp;and pass in the path to your assembly. &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;Public Sub OpenDocumentInLastActiveLOD()
    Dim strFullFileName As String
    strFullFileName = "C:\temp\Assembly1.iam"
    
    ' Set a reference to the FileManager object.
    Dim oFileManager As FileManager
    Set oFileManager = ThisApplication.FileManager
    
    ' Get the name of the last active Level of Detail (LOD) Representation.
    Dim strLastActiveLOD As String
    strLastActiveLOD = oFileManager.GetLastActiveLevelOfDetailRepresentation(strFullFileName)
    
    ' Use the full file name and LOD name to get the full document name.
    Dim strFullDocumentName As String
    strFullDocumentName = oFileManager.GetFullDocumentName(strFullFileName, strLastActiveLOD)
    
    ' Open the document in the last active LOD.
    Dim oDoc As AssemblyDocument
    Set oDoc = ThisApplication.Documents.Open(strFullDocumentName)
End Sub
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Wayne&lt;/P&gt;</description>
      <pubDate>Thu, 14 Jul 2016 16:47:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/open-a-iam-file-with-excel-vba/m-p/6436492#M65476</guid>
      <dc:creator>wayne.brill</dc:creator>
      <dc:date>2016-07-14T16:47:52Z</dc:date>
    </item>
  </channel>
</rss>

