<?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 does not work in inventor 2020 in Inventor Programming - iLogic, Macros, AddIns &amp; Apprentice</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/vba-does-not-work-in-inventor-2020/m-p/9947574#M119218</link>
    <description>&lt;P&gt;Thank you Rene!! i appreciate the response&lt;/P&gt;</description>
    <pubDate>Thu, 17 Dec 2020 21:32:42 GMT</pubDate>
    <dc:creator>rickER9UF</dc:creator>
    <dc:date>2020-12-17T21:32:42Z</dc:date>
    <item>
      <title>vba does not work in inventor 2020</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/vba-does-not-work-in-inventor-2020/m-p/9935350#M119075</link>
      <description>&lt;P&gt;i have the below code with a button that exports a drawing to dwf in one click, works great in 2014 however just got 2020 and the program is catching in the red text line.........any ideas would be great as this command is quick and handy, thank you&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sub dwfmaker()&lt;BR /&gt;MsgBox "DWF-filer creating", vbInformation&lt;/P&gt;&lt;P&gt;Dim invApp As Inventor.Application&lt;BR /&gt;Set invApp = ThisApplication&lt;BR /&gt;' invApp.SilentOperation = True&lt;/P&gt;&lt;P&gt;Dim idwDoc As Inventor.DrawingDocument&lt;BR /&gt;Set idwDoc = invApp.ActiveDocument&lt;/P&gt;&lt;P&gt;Dim dwfFile As String&lt;BR /&gt;Dim laserdir As String&lt;BR /&gt;Dim FirstLet As Variant&lt;BR /&gt;Dim Output As Integer&lt;BR /&gt;Dim MyCheck As String&lt;BR /&gt;&lt;BR /&gt;FirstLet = Left(idwDoc.DisplayName, 1)&lt;BR /&gt;MyCheck = IsNumeric(FirstLet)&lt;BR /&gt;If MyCheck = True Then&lt;BR /&gt;laserdir = "x:\" + "Numbered" + "\"&lt;BR /&gt;Else&lt;BR /&gt;laserdir = "x:\" + FirstLet + "\"&lt;BR /&gt;End If&lt;BR /&gt;dwfFile = laserdir + idwDoc.DisplayName + ".dwf"&lt;/P&gt;&lt;P&gt;'determine of dwf already exists&lt;BR /&gt;Dim FilePath As String&lt;BR /&gt;FilePath = ""&lt;BR /&gt;&lt;BR /&gt;FilePath = Dir(dwfFile)&lt;BR /&gt;If FilePath = "" Then&lt;/P&gt;&lt;P&gt;'MsgBox "File doesn't exist"&lt;BR /&gt;Output = MsgBox("File Doesn't Exist", vbOKCancel)&lt;BR /&gt;'If Output = 1 Then&lt;BR /&gt;With invApp.CommandManager&lt;BR /&gt;Call .PostPrivateEvent(kFileNameEvent, dwfFile)&lt;BR /&gt;&lt;FONT color="#FF00FF"&gt;Call .StartCommand(kFileSaveCopyAsCommand)&lt;/FONT&gt;&lt;BR /&gt;End With&lt;BR /&gt;Set idwDoc = Nothing&lt;/P&gt;&lt;P&gt;Else&lt;BR /&gt;Output = MsgBox("File Exists", vbOKCancel)&lt;BR /&gt;Output = 2&lt;BR /&gt;End If&lt;BR /&gt;&lt;BR /&gt;If Output = 2 Then&lt;BR /&gt;Output = MsgBox("Do You Want To Overwrite Existing File?", vbYesNoCancel)&lt;BR /&gt;End If&lt;BR /&gt;If Output = 6 Then&lt;BR /&gt;With invApp.CommandManager&lt;BR /&gt;Call .PostPrivateEvent(kFileNameEvent, dwfFile)&lt;BR /&gt;Call .StartCommand(kFileSaveCopyAsCommand)&lt;BR /&gt;End With&lt;BR /&gt;&lt;BR /&gt;ElseIf Output = 7 Then&lt;BR /&gt;Else&lt;BR /&gt;Output = 2&lt;BR /&gt;End If&lt;BR /&gt;&lt;BR /&gt;End Sub&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 12 Dec 2020 20:21:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/vba-does-not-work-in-inventor-2020/m-p/9935350#M119075</guid>
      <dc:creator>rickER9UF</dc:creator>
      <dc:date>2020-12-12T20:21:58Z</dc:date>
    </item>
    <item>
      <title>Betreff: vba does not work in inventor 2020</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/vba-does-not-work-in-inventor-2020/m-p/9943962#M119151</link>
      <description>&lt;P&gt;From Inv2009(!) documentation:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Note 2&lt;/STRONG&gt;. The &lt;EM&gt;CommandManager.StartCommand (commandID)&lt;/EM&gt; method to launch in Inventor command has been &lt;STRONG&gt;depreciated&lt;/STRONG&gt;. Please use the &lt;EM&gt;ControlDefinition.Execute&lt;/EM&gt; method instead.&lt;/P&gt;</description>
      <pubDate>Wed, 16 Dec 2020 14:30:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/vba-does-not-work-in-inventor-2020/m-p/9943962#M119151</guid>
      <dc:creator>Rene_Gerlach</dc:creator>
      <dc:date>2020-12-16T14:30:49Z</dc:date>
    </item>
    <item>
      <title>Re: vba does not work in inventor 2020</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/vba-does-not-work-in-inventor-2020/m-p/9944244#M119153</link>
      <description>&lt;P&gt;See if this edit works for you instead:&lt;/P&gt;&lt;P&gt;(I replaced your 'With' blocks with a simple SaveAs() method.)&lt;/P&gt;&lt;LI-CODE lang="general"&gt;Sub dwfmaker()
    MsgBox "DWF-filer creating", vbInformation
    
    Dim invApp As Inventor.Application
    Set invApp = ThisApplication
    ' invApp.SilentOperation = True
    
    Dim idwDoc As Inventor.DrawingDocument
    Set idwDoc = invApp.ActiveDocument
    
    Dim dwfFile As String
    Dim laserdir As String
    Dim FirstLet As Variant
    Dim Output As Integer
    Dim MyCheck As String
    
    FirstLet = Left(idwDoc.DisplayName, 1)
    MyCheck = IsNumeric(FirstLet)
    If MyCheck = True Then
        laserdir = "x:\" + "Numbered" + "\"
    Else
        laserdir = "x:\" + FirstLet + "\"
    End If
    dwfFile = laserdir + idwDoc.DisplayName + ".dwf"
    
    'determine of dwf already exists
    Dim FilePath As String
    FilePath = ""
    
    FilePath = Dir(dwfFile)
    If FilePath = "" Then
        'MsgBox "File doesn't exist"
        Output = MsgBox("File Doesn't Exist", vbOKCancel)
        Call idwDoc.SaveAs(dwfFile, True) 'True = SaveCopyAs
        Set idwDoc = Nothing
    Else
        Output = MsgBox("File Exists", vbOKCancel)
        Output = 2
    End If
    
    If Output = 2 Then
        Output = MsgBox("Do You Want To Overwrite Existing File?", vbYesNoCancel)
    End If
    If Output = 6 Then
        Call idwDoc.SaveAs(dwfFile, True) 'True = SaveCopyAs
    ElseIf Output = 7 Then
    Else
        Output = 2
    End If
End Sub&lt;/LI-CODE&gt;&lt;P&gt;If this solved your problem, or answered your question, please click &lt;SPAN style="background-color: green; color: white;"&gt;&lt;STRONG&gt;ACCEPT SOLUTION&lt;/STRONG&gt;&lt;/SPAN&gt;.&lt;BR /&gt;Or, if this helped you, please click 'LIKE' &lt;SPAN&gt;&lt;img class="lia-deferred-image lia-image-emoji" src="https://forums.autodesk.com/html/@7401B55A0A518861312A0F851CD29320/emoticons/1f44d.png" alt=":thumbs_up:" title=":thumbs_up:" /&gt;&lt;/SPAN&gt;.&lt;/P&gt;&lt;P&gt;If you have time, please... Vote For &lt;A href="https://forums.autodesk.com/t5/forums/recentpostspage/post-type/message/interaction-style/idea/user-id/7812054/" target="_blank"&gt;My IDEAS &lt;SPAN&gt;&lt;img class="lia-deferred-image lia-image-emoji" src="https://forums.autodesk.com/html/@B166FEBB95D67CFA84899D32D8E17FC1/emoticons/1f4a1.png" alt=":light_bulb:" title=":light_bulb:" /&gt;&lt;/SPAN&gt;&lt;/A&gt;and Explore &lt;A href="https://knowledge.autodesk.com/profile/LTSUSR7HXMSAE/articles" target="_blank"&gt;My CONTRIBUTIONS &lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://help.autodesk.com/view/INVNTOR/2021/ENU/" target="_blank"&gt;Inventor 2021 Help &lt;/A&gt;| &lt;A href="https://forums.autodesk.com/t5/inventor-forum/bd-p/78/" target="_blank"&gt;Inventor Forum &lt;/A&gt;| &lt;A href="https://forums.autodesk.com/t5/inventor-customization/bd-p/120/" target="_blank"&gt;Inventor Customization Forum &lt;/A&gt;| &lt;A href="https://forums.autodesk.com/t5/inventor-ideas/idb-p/v1232/" target="_blank"&gt;Inventor Ideas Forum &lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Dec 2020 16:19:41 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/vba-does-not-work-in-inventor-2020/m-p/9944244#M119153</guid>
      <dc:creator>WCrihfield</dc:creator>
      <dc:date>2020-12-16T16:19:41Z</dc:date>
    </item>
    <item>
      <title>Betreff: vba does not work in inventor 2020</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/vba-does-not-work-in-inventor-2020/m-p/9945650#M119178</link>
      <description>&lt;P&gt;Just a comment:&lt;/P&gt;&lt;P&gt;Please &lt;U&gt;&lt;STRONG&gt;never ever&lt;/STRONG&gt;&lt;/U&gt; use the &lt;EM&gt;DisplayName&lt;/EM&gt; for the filename! The &lt;EM&gt;DisplayName&lt;/EM&gt; can contain characters that are not allowed for filenames, like "/\&amp;lt;:|".&amp;nbsp;&lt;/P&gt;&lt;P&gt;Try instead:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Dim fso As New Scripting.FileSystemObject
dwfFile = laserdir + fso.GetBaseName(idwDoc.FullFileName) + ".dwf"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Dec 2020 07:11:41 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/vba-does-not-work-in-inventor-2020/m-p/9945650#M119178</guid>
      <dc:creator>Rene_Gerlach</dc:creator>
      <dc:date>2020-12-17T07:11:41Z</dc:date>
    </item>
    <item>
      <title>Re: vba does not work in inventor 2020</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/vba-does-not-work-in-inventor-2020/m-p/9947574#M119218</link>
      <description>&lt;P&gt;Thank you Rene!! i appreciate the response&lt;/P&gt;</description>
      <pubDate>Thu, 17 Dec 2020 21:32:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/vba-does-not-work-in-inventor-2020/m-p/9947574#M119218</guid>
      <dc:creator>rickER9UF</dc:creator>
      <dc:date>2020-12-17T21:32:42Z</dc:date>
    </item>
  </channel>
</rss>

