View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Desert Piranha[_79_] Desert Piranha[_79_] is offline
external usenet poster
 
Posts: 1
Default Desktop shortcut


Norman Jones Wrote:
Hi Greg,

I can work out how to have the code activate for the first time, jus

not
how to get a shortcut to the desktop


Try:

'=============
Public Sub Tester()
Dim WSH As Object
Dim MyShortCut As Object
Dim destPath As String
Dim srcPath As String

srcPath = ThisWorkbook.FullName

Set WSH = CreateObject("WScript.Shell")
destPath = WSH.SpecialFolders.Item("Desktop")

Set MyShortCut = WSH.CreateShortcut(destPath & "\Test.lnk")
With MyShortCut
.TargetPath = srcPath
.Save
End With
Set WSH = Nothing
End Sub
'<<=============


---
Regards,
Norman

Hi Norman,
For me, this code does not create a shortcut on the desktop, bu
instead he

C:\Documents and Settings\Owner\Applicatio
Data\Microsoft\Office\Recent

Why is that

--
Desert Piranh

-----------------------------------------------------------------------
Desert Piranha's Profile: http://www.excelforum.com/member.php...fo&userid=2893
View this thread: http://www.excelforum.com/showthread.php?threadid=55314