Results 1 to 20 of 20

Thread: Open DXF file from a button on the toolbar or userform is not working, Need help?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Open DXF file from a button on the toolbar or userform is not working, Need help?

    Hello my Name is Johnnydotcom and I use VBA to manipulate spreadsheet for manufacturing support.

    I have a Simple Macro that i use to open files for a preview function, for example.

    conditions met are:
    The current cell in any spreadsheet is forced to cells that contain the correct information for the file name.
    A userform is used to select the files location and sets that location in any spreadsheets H3 Range.

    it starts the edrawings application, However, the file does not open.
    I can explore the same location find the file and open the file without any problems.

    The Immediate Window Shows the correct file name string.

    here it is

    Sub Open_DXF()
        Dim pth As String, fName As String, CurVal As String    
        CurVal = ActiveCell.Value
        pth = Range("H3").Value
        fName = Dir(pth & "\*" & CurVal & "*.dxf")    
        ' currently active to support trouble shooting
        Debug.Print fName    
        If fName = "" Then
            MsgBox ("File does not exist in this location")
            Exit Sub
        End If
        ActiveWorkbook.FollowHyperlink pth & "" & fName
    End Sub
    Last edited by Aussiebear; 05-15-2025 at 10:44 PM. Reason: Added code tags

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •