用VBA创建EXCEL表的桌面快捷方式

ContractedBlock.gif ExpandedBlockStart.gif 代码
 
     
1 Sub CreatShortCut()
2 Dim WSHShell
3 Set WSHShell = CreateObject ( " WScript.Shell " )
4 Dim MyShortcut, DesktopPath
5 DesktopPath = WSHShell.SpecialFolders( " Desktop " )
6 Set MyShortcut = WSHShell.CreateShortcut(DesktopPath & " \test.xls.lnk " )
7 With MyShortcut
8 .TargetPath = WSHShell.ExpandEnvironmentStrings( " e:\test.xls " )
9 .Save
10 End With
11   End Sub

 

转载于:https://www.cnblogs.com/laoyebin/archive/2010/02/26/1674537.html

你可能感兴趣的:(用VBA创建EXCEL表的桌面快捷方式)