Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
windows file shortcut using vb
i would like vb to create a shortcut to a file i have and put that shortcut
into a parent folder. I think that the ShellLink function will work but i don't know how to do it. Any suggestions? im stumped. Thanks |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
windows file shortcut using vb
Here is some code
Sub CreateShortCut() Dim oWSH As Object Dim oShortcut As Object Dim sPath As String Set oWSH = CreateObject("WScript.Shell") sPath = "C:\myFolder" Set oShortcut = oWSH.CreateShortCut(sPath & "\" & _ 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) "Mike C" wrote in message ... i would like vb to create a shortcut to a file i have and put that shortcut into a parent folder. I think that the ShellLink function will work but i don't know how to do it. Any suggestions? im stumped. Thanks |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
windows file shortcut using vb
Thanks that helped me a whole lot!
"Bob Phillips" wrote: Here is some code Sub CreateShortCut() Dim oWSH As Object Dim oShortcut As Object Dim sPath As String Set oWSH = CreateObject("WScript.Shell") sPath = "C:\myFolder" Set oShortcut = oWSH.CreateShortCut(sPath & "\" & _ 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) "Mike C" wrote in message ... i would like vb to create a shortcut to a file i have and put that shortcut into a parent folder. I think that the ShellLink function will work but i don't know how to do it. Any suggestions? im stumped. Thanks |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Using a Windows Shortcut to Open to Specific Sheet in Workbook | Excel Discussion (Misc queries) | |||
keyboard shortcut for moving between windows | Excel Discussion (Misc queries) | |||
Excel shortcut/Multiple windows weirdness | Excel Discussion (Misc queries) | |||
Desktop shortcut to a named Excel file - every time I open it adds a "1" to the file name - how to disable? | Setting up and Configuration of Excel | |||
Keyboard shortcut for Maximizing Windows | Excel Programming |