ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Creating a SHORTCUT to a file in XLSTART (https://www.excelbanter.com/excel-programming/281674-creating-shortcut-file-xlstart.html)

jason

Creating a SHORTCUT to a file in XLSTART
 
probably a lot easier than I imagine this one!
i'd like to progrmmatically create a shortcut to a file in my XLstart file.

anybody any ideas?

Steve Yandl[_3_]

Creating a SHORTCUT to a file in XLSTART
 
You can use the WScript shell object. The sub below will find the XLstart
folder and place a shortcut called StartABC that targets the workbook
C:\test\abc.xls.

Sub xlstartLINK()
Dim wsh As Object
Dim lnk As Variant
Dim strXLstart As String
strXLstart = Application.StartupPath
Set wsh = CreateObject("WScript.Shell")
Set lnk = wsh.CreateShortcut(strXLstart & "\StartABC.lnk")
lnk.TargetPath = "C:\test\abc.xls"
lnk.Save
End Sub

Steve


"jason" wrote in message
om...
probably a lot easier than I imagine this one!
i'd like to progrmmatically create a shortcut to a file in my XLstart

file.

anybody any ideas?




jason

Creating a SHORTCUT to a file in XLSTART
 
Cheers Steve

"Steve Yandl" wrote in message ...
You can use the WScript shell object. The sub below will find the XLstart
folder and place a shortcut called StartABC that targets the workbook
C:\test\abc.xls.

Sub xlstartLINK()
Dim wsh As Object
Dim lnk As Variant
Dim strXLstart As String
strXLstart = Application.StartupPath
Set wsh = CreateObject("WScript.Shell")
Set lnk = wsh.CreateShortcut(strXLstart & "\StartABC.lnk")
lnk.TargetPath = "C:\test\abc.xls"
lnk.Save
End Sub

Steve


"jason" wrote in message
om...
probably a lot easier than I imagine this one!
i'd like to progrmmatically create a shortcut to a file in my XLstart

file.

anybody any ideas?



All times are GMT +1. The time now is 03:10 PM.

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