Automatically create at shortcut to a file

后端 未结 1 695
别跟我提以往
别跟我提以往 2021-01-16 08:02

I have a small piece of code under a command button click which saves the workbook file with a new name in a new location, I am wondering if it is possible to also automatic

相关标签:
1条回答
  • 2021-01-16 08:51

    You basically need to add something like this:

    Dim sShortcutLocation As String
    
    sShortcutLocation = "C:\blah\workbook shortcut.lnk"
    
    With CreateObject("WScript.Shell").CreateShortcut(sShortcutLocation)
        .TargetPath = myFileName
        .Description = "Shortcut to the file"
         .Save
    End With
    

    changing the location to wherever you want.

    0 讨论(0)
提交回复
热议问题