Creating a SHORTCUT to a file in XLSTART

J

jason

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?
 
S

Steve Yandl

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
 
J

jason

Cheers Steve

Steve Yandl said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top