RayportingMonkey;189163 said:
Hey Leith,
Thanks for the response.
The location where the windows shortcut will reside is simply C:Share.
As for the path to the actual workbook, it is a very long UNC path
Suffice
to say that if you reference it as \ServerNameLocation I can replac
it
with the applicable path.
The specific filename can also be "filename.xls" or something generi
as I
will be using this for more than one instance anyway.
Again, thanks for the response.
Regards,
Ray
--
"Trying to make reports so easy... even a monkey could run ''em!"
Ross' (
http://www.thecodecage.com/forumz/members/leith-ross.html)
Code Cage Forums
(
http://www.thecodecage.com/forumz/showthread.php?t=52104)
Hello Ray,
I was out of my office for while. My apologies for the delay. You ca
change the values in the example code to match what you are using.
have never used this create a shortcut on a network, but Microsoft say
it can. We'll see.
============================================
'Written: January 19, 2009
'Author: Leith Ross
Sub MakeShortCut()
Dim FileName As String
Dim FolderPath As String
Dim objShell As Object
Dim objShortCut As Object
Dim ShortcutFolder As String
FolderPath = "C:\Documents and Settings\Admin.ADMINS\M
Documents\"
FileName = "Search Database"
FileType = ".xls"
Set objShell = CreateObject("WScript.Shell")
'If the folder is a virtual folder then use this syntax
ShortcutFolder = objShell.SpecialFolders("Desktop") & "\"
'If the folder has a physical location then use this syntax
'ShortcutFolder = "C:\Program Files\"
Set objShortCut = objShell.CreateShortcut(ShortcutFolder & FileNam
& ".lnk")
With objShortCut
.TargetPath = FolderPath & FileName & FileType
.WindowStyle = 1 'Normal focus
.Save
End With
Set objShell = Nothing
End Sub
===========================================
--
Leith Ros
Sincerely,
Leith Ross
'The Code Cage' (
http://www.thecodecage.com/