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

代码
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

 

posted @ 2010-02-26 20:42  RobinLao  阅读(620)  评论(0编辑  收藏  举报