+ Reply to Thread
Results 1 to 3 of 3

HELP for a macro to create a shortcut of an excel file on the desk

  1. #1
    Francesco
    Guest

    HELP for a macro to create a shortcut of an excel file on the desk


    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

  2. #2
    Bob Phillips
    Guest

    Re: HELP for a macro to create a shortcut of an excel file on the desk

    '----------------------------------------------------------------
    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




  3. #3
    Francesco
    Guest

    Re: HELP for a macro to create a shortcut of an excel file on the

    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

    >
    >
    >


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1