elgringo56
Well-known Member
- Joined
- Apr 15, 2002
- Messages
- 869
Can I, using VBA, create a desktop shortcut with icon that will allow the user to double click it open a given folder such as C:\xxxx\yyyy?
Page 363, Another type of Message Box
Excel can access the Windows Scripting Host (WScript) and display...
...if you decide to use this alternate message box, be aware that system administrators often disable the Windows Scripting Host because of the threat of viruses. If the Windows Scripting Host is disabled, the code will generate an error.
Declare Function fCreateShellLink Lib "VB5STKIT.DLL" _
(ByVal lpstrFolderName As String, ByVal lpstrLinkName As String, _
ByVal lpstrLinkPath As String, ByVal lpstrLinkArgs As String) As Long
'
Sub CreateShortCutFile()
LngResult = fCreateShellLink("..\..\Desktop", "MyShortCutFile", _
"F:\My Folders\Test.xls", "")
End Sub
Declare Function fCreateShellLink Lib "VB5STKIT.DLL" _
(ByVal lpstrFolderName As String, ByVal lpstrLinkName As String, _
ByVal lpstrLinkPath As String, ByVal lpstrLinkArgs As String) As Long
'
Sub CreateShortCutFolder()
LngResult = fCreateShellLink("..\..\Desktop", "MyShortCutFolder", _
"F:\My Folders", "")
End Sub