Hi all
Is it possible to have the activeworkbook when it saves for the very first
time to automatically put a shortcut onto the desktop?
I can work out how to have the code activate for the first time, just not
how to get a shortcut to the desktop
Thanks
Greg
Hi Greg,
> I can work out how to have the code activate for the first time, just 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
"Greg" <laptop@nothereihug.com.au> wrote in message
news:e75q9g$a2o$1@lust.ihug.co.nz...
> Hi all
>
> Is it possible to have the activeworkbook when it saves for the very first
> time to automatically put a shortcut onto the desktop?
>
> I can work out how to have the code activate for the first time, just not
> how to get a shortcut to the desktop
>
> Thanks
>
> Greg
>
>
Thanks Norman Exactly what I was hoping for
Greg
"Norman Jones" <normanjones@whereforartthou.com> wrote in message
news:Oj9oVz4kGHA.1456@TK2MSFTNGP04.phx.gbl...
> Hi Greg,
>
>> I can work out how to have the code activate for the first time, just 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
>
>
> "Greg" <laptop@nothereihug.com.au> wrote in message
> news:e75q9g$a2o$1@lust.ihug.co.nz...
>> Hi all
>>
>> Is it possible to have the activeworkbook when it saves for the very
>> first time to automatically put a shortcut onto the desktop?
>>
>> I can work out how to have the code activate for the first time, just not
>> how to get a shortcut to the desktop
>>
>> Thanks
>>
>> Greg
>>
>>
>
>
Hi Norman,Originally Posted by Norman Jones
For me, this code does not create a shortcut on the desktop, but instead here:
C:\Documents and Settings\Owner\Application Data\Microsoft\Office\Recent
Why is that?
Thx
Dave
"The game is afoot Watson"
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks