<?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: Opening File to Edit with vba script in Inventor Programming Forum</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-forum/opening-file-to-edit-with-vba-script/m-p/13345429#M1887</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am starting from a console command from which i call a wsf with multiple operations so as an example:&lt;/P&gt;&lt;LI-CODE lang="general"&gt;cscript //Job:fileOpener CADInterface.wsf CAD_filepath&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The Wscript is the command line input so the "CAD_Filepath" that is written in the commandline.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The part of the wsf is :&lt;/P&gt;&lt;LI-CODE lang="general"&gt;	&amp;lt;/job&amp;gt;
	
		&amp;lt;job id="fileOpener"&amp;gt;
		&amp;lt;reference guid="d98a091d-3a0f-4c3e-b36e-61f62068d488"/&amp;gt;
		&amp;lt;script language="VBScript" src="scripts/fileOpener.vbs"/&amp;gt;
		&amp;lt;script language="VBScript"&amp;gt;
			main()
		&amp;lt;/script&amp;gt;
	&amp;lt;/job&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I start with everything closed.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;BR&lt;/P&gt;&lt;P&gt;Georg&lt;/P&gt;</description>
    <pubDate>Fri, 28 Feb 2025 15:19:50 GMT</pubDate>
    <dc:creator>georg_hartmannV6HPW</dc:creator>
    <dc:date>2025-02-28T15:19:50Z</dc:date>
    <item>
      <title>Opening File to Edit with vba script</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/opening-file-to-edit-with-vba-script/m-p/13344878#M1885</link>
      <description>&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;I am starting to lose some of my marbles.&lt;/P&gt;&lt;P&gt;I want to use a script in vba, that opens an inventor part and allows the user to edit the file.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;my code is as follows:&lt;/P&gt;&lt;LI-CODE lang="visual-basic"&gt;Dim InvApp, InvDoc
Dim fso, fullPathToFile,strFileName

Sub main()
	'On Error Resume Next
    wscript.Echo("&amp;gt;&amp;gt;&amp;gt; FileOpener v1  &amp;lt;&amp;lt;&amp;lt;")

    ' Initialize Inventor
    set InvApp = CreateObject("Inventor.Application")
    InvApp.Visible = True 
    
    ' Generate absolute filepath to CAD-File 
    strFileName = Wscript.arguments(0)
    set fso = CreateObject("Scripting.FileSystemObject")
    fullPathToFile = fso.GetAbsolutePathName(strFileName)

    Set InvDoc = InvApp.Documents.open(fullPathToFile,true)

End Sub&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the problem with this is, that the tabs for 3D modeling and sketch and so on are missing.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="georg_hartmannV6HPW_0-1740736138733.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1472399iFA92041F563536E1/image-size/medium?v=v2&amp;amp;px=400" role="button" title="georg_hartmannV6HPW_0-1740736138733.png" alt="georg_hartmannV6HPW_0-1740736138733.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I open the part manually, everything is there&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="georg_hartmannV6HPW_1-1740736195265.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1472400i55003C177B602163/image-size/medium?v=v2&amp;amp;px=400" role="button" title="georg_hartmannV6HPW_1-1740736195265.png" alt="georg_hartmannV6HPW_1-1740736195265.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i went through all documentation, that i could find, used chat gpt and my colleagues, but still i have no answer.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I added&lt;/P&gt;&lt;LI-CODE lang="visual-basic"&gt;    InvApp.UserInterfaceManager.ActiveDocument.Update&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and tried&lt;/P&gt;&lt;LI-CODE lang="visual-basic"&gt;InvApp.UserInterfaceManager.ResetRibbonInterface() 
InvApp.UserInterfaceManager.Ribbons.Item("Part")
InvApp.UserInterfaceManager.Update
InvApp.UserInterfaceManager.ActivateTab("Id_Part")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But it only adds the tabs for 1-2 seconds and removes them afterwards.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does anybody now how to set the tabs, when I open it by script??&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;Georg&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Feb 2025 10:05:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/opening-file-to-edit-with-vba-script/m-p/13344878#M1885</guid>
      <dc:creator>georg_hartmannV6HPW</dc:creator>
      <dc:date>2025-02-28T10:05:31Z</dc:date>
    </item>
    <item>
      <title>Re: Opening File to Edit with vba script</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/opening-file-to-edit-with-vba-script/m-p/13345331#M1886</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/14134776"&gt;@georg_hartmannV6HPW&lt;/a&gt;.&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;What environment are you starting this code from?&lt;/LI&gt;
&lt;LI&gt;Are you writing this code from within the VBA Editor dialog that can be found within Inventor, on the Tools tab, after it has been installed?
&lt;UL&gt;
&lt;LI&gt;If so, then there is no need to 'create' an instance of Inventor, because it will already be running, and you can use the 'ThisApplication' object, which will already represent the Inventor.Application object.&lt;/LI&gt;
&lt;/UL&gt;
&lt;/LI&gt;
&lt;LI&gt;Or is it in a VBA editor of something like Excel?&lt;/LI&gt;
&lt;LI&gt;Or is this not really VBA at all, but some other coding language?&lt;/LI&gt;
&lt;LI&gt;Are you trying to use this code from within an iLogic rule?&lt;/LI&gt;
&lt;LI&gt;What is "wscript" in that code example supposed to be?&amp;nbsp; (it is being used with two different capitalization states, so that may be another issue)&lt;/LI&gt;
&lt;/UL&gt;</description>
      <pubDate>Fri, 28 Feb 2025 14:36:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/opening-file-to-edit-with-vba-script/m-p/13345331#M1886</guid>
      <dc:creator>WCrihfield</dc:creator>
      <dc:date>2025-02-28T14:36:17Z</dc:date>
    </item>
    <item>
      <title>Re: Opening File to Edit with vba script</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/opening-file-to-edit-with-vba-script/m-p/13345429#M1887</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am starting from a console command from which i call a wsf with multiple operations so as an example:&lt;/P&gt;&lt;LI-CODE lang="general"&gt;cscript //Job:fileOpener CADInterface.wsf CAD_filepath&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The Wscript is the command line input so the "CAD_Filepath" that is written in the commandline.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The part of the wsf is :&lt;/P&gt;&lt;LI-CODE lang="general"&gt;	&amp;lt;/job&amp;gt;
	
		&amp;lt;job id="fileOpener"&amp;gt;
		&amp;lt;reference guid="d98a091d-3a0f-4c3e-b36e-61f62068d488"/&amp;gt;
		&amp;lt;script language="VBScript" src="scripts/fileOpener.vbs"/&amp;gt;
		&amp;lt;script language="VBScript"&amp;gt;
			main()
		&amp;lt;/script&amp;gt;
	&amp;lt;/job&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I start with everything closed.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;BR&lt;/P&gt;&lt;P&gt;Georg&lt;/P&gt;</description>
      <pubDate>Fri, 28 Feb 2025 15:19:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/opening-file-to-edit-with-vba-script/m-p/13345429#M1887</guid>
      <dc:creator>georg_hartmannV6HPW</dc:creator>
      <dc:date>2025-02-28T15:19:50Z</dc:date>
    </item>
    <item>
      <title>Re: Opening File to Edit with vba script</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/opening-file-to-edit-with-vba-script/m-p/13345504#M1888</link>
      <description>&lt;P&gt;Thank you for the additional information.&amp;nbsp; That helps a lot.&amp;nbsp; Unfortunately, I know nothing about console coding or 'VBScript', so I will likely not be able to help much in this specific case.&amp;nbsp; About all I know is that I have read that VBScript is very different than either VBA or VB.NET, and is essentially a 'lighter' coding language for smaller 'scripting' tasks, rather than for full desktop application development.&amp;nbsp; Hopefully some of the others here in the forum will look into this for you, and be able to help more.&amp;nbsp; Good luck.&lt;/P&gt;</description>
      <pubDate>Fri, 28 Feb 2025 15:48:33 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/opening-file-to-edit-with-vba-script/m-p/13345504#M1888</guid>
      <dc:creator>WCrihfield</dc:creator>
      <dc:date>2025-02-28T15:48:33Z</dc:date>
    </item>
  </channel>
</rss>

