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

In this case I recommend you to try iLogic. It is much more powerful then VBA and IO.Path functionality is also available.

Lot of syntax is identical in VBA and iLogic. But if you want to continue using VBA, you can use FileSystemObject

 

 

Sub FileSystemObjectTest()
    'With reference to 'Microsoft Scripting Runtime'
    'It enables intelliSense
'    Dim fs As FileSystemObject
'    Set fs = New FileSystemObject
    
    'Without reference
    Set fs = CreateObject("Scripting.FileSystemObject")
    
    
    Dim fileName As String
    fileName = ThisApplication.ActiveDocument.FullFileName
    
    fileFolder = fs.GetParentFolderName(fileName)
    excelFile = fs.BuildPath(fileFolder, "ExcelFile.xls")
    
End Sub