Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
WCrihfield
in reply to: rickER9UF

See if this edit works for you instead:

(I replaced your 'With' blocks with a simple SaveAs() method.)

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

If this solved your problem, or answered your question, please click ACCEPT SOLUTION.
Or, if this helped you, please click 'LIKE' :thumbs_up:.

If you have time, please... Vote For My IDEAS :light_bulb:and Explore My CONTRIBUTIONS

Inventor 2021 Help | Inventor Forum | Inventor Customization Forum | Inventor Ideas Forum

Wesley Crihfield

EESignature

(Not an Autodesk Employee)