ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Short cuts? (https://www.excelbanter.com/excel-discussion-misc-queries/19756-short-cuts.html)

Bob Phillips

Hi Greg,

Here is some code

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

RP
(remove nothere from the email address if mailing direct)


"Greg" wrote in message
...
Is there a way to get excel in a macro to put a shortcut to the current

file
on to the desktop?

Thanks in advance

Greg





Trevor Shuttleworth

Greg

your system clock seems to be way ahead of itself.

Regards

Trevor


"Greg" wrote in message
...
Is there a way to get excel in a macro to put a shortcut to the current
file
on to the desktop?

Thanks in advance

Greg





Greg

Short cuts?
 
Is there a way to get excel in a macro to put a shortcut to the current file
on to the desktop?

Thanks in advance

Greg



Greg

Thanks for that Bob

Greg



Greg

Thanks Trevor

Will check it out

Greg




All times are GMT +1. The time now is 05:53 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com