Hello
Using windowsXP Prof. and excel 2003
Is there a way to create a shortcut of an excel file on the Desktop using a
macro?
If yes, can anyone tell me how?
Thanks
Francesco
Hello
Using windowsXP Prof. and excel 2003
Is there a way to create a shortcut of an excel file on the Desktop using a
macro?
If yes, can anyone tell me how?
Thanks
Francesco
'----------------------------------------------------------------
Sub CreateShortCut()
'----------------------------------------------------------------
Dim oWSH As Object
Dim oShortcut As Object
Dim sPathDeskTop As String
Set oWSH = CreateObject("WScript.Shell")
sPathDeskTop = oWSH.SpecialFolders("Desktop")
Set oShortcut = oWSH.CreateShortCut(sPathDeskTop & "\" & _
ActiveWorkbook.Name & ".lnk")
With oShortcut
.TargetPath = ActiveWorkbook.FullName
.Save
End With
Set oWSH = Nothing
End Sub
--
HTH
Bob Phillips
(remove nothere from email address if mailing direct)
"Francesco" <[email protected]> wrote in message
news:[email protected]...
>
> Hello
>
> Using windowsXP Prof. and excel 2003
>
> Is there a way to create a shortcut of an excel file on the Desktop using
a
> macro?
> If yes, can anyone tell me how?
> Thanks
> Francesco
Thanks a lot Bob it works fine
Regards
Francesco
"Bob Phillips" wrote:
> '----------------------------------------------------------------
> Sub CreateShortCut()
> '----------------------------------------------------------------
> Dim oWSH As Object
> Dim oShortcut As Object
> Dim sPathDeskTop As String
>
> Set oWSH = CreateObject("WScript.Shell")
> sPathDeskTop = oWSH.SpecialFolders("Desktop")
>
> Set oShortcut = oWSH.CreateShortCut(sPathDeskTop & "\" & _
> ActiveWorkbook.Name & ".lnk")
> With oShortcut
> .TargetPath = ActiveWorkbook.FullName
> .Save
> End With
> Set oWSH = Nothing
>
> End Sub
>
>
> --
> HTH
>
> Bob Phillips
>
> (remove nothere from email address if mailing direct)
>
> "Francesco" <[email protected]> wrote in message
> news:[email protected]...
> >
> > Hello
> >
> > Using windowsXP Prof. and excel 2003
> >
> > Is there a way to create a shortcut of an excel file on the Desktop using
> a
> > macro?
> > If yes, can anyone tell me how?
> > Thanks
> > Francesco
>
>
>
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks