Chatgpt has some answer:
example (will create test.lnk of Document folder)' from Chatgpt Sub CreateSymlink(ByVal Target As String, ByVal Link As String) Dim cmd As String ' Ensure paths are wrapped in quotes ' cmd = "cmd /c mklink /D """ & Link & """ """ & Target & """" cmd = "cmd /c mklink """ & Link & """ """ & Target & """" ' Create the symbolic link Shell cmd, vbHide 'vbNormalFocus End Sub
Private Sub test() Dim path As String path = Environ("userprofile") & "\documents\" Call CreateSymlink(path & "fileNameHere.xlsx", path & "test.lnk") End Sub




Reply With Quote