LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 310
Default copy shortcut to desktop

Hi!

I'm new to excel but kinda familiar with VBA for Access. I would like to
copy stored shortcuts(.lnk) to the users desktop. I have the following code.
I was trying the FileCopy but I'm pretty sure I should be using CopyFile.
What do I need to make the FileSystemObject work?

Private Sub cmdCreateDesktopShortcut_Click()

'Dim FSO As FileSystemObject
Dim strUserDesktop
Dim strDrive As String
Dim strTempPath As String
Dim strSrcePath As String

'Set FSO = New FileSystemObject

'Set up Source string

strSrcePath = "bwes.net\Barberton file
shares\DocControlPLM\BatchLoadFiles\ScriptsAndZips \Shortcuts\Consolidated -
Approve.lnk"

'Set up Destination string

strDrive = "D:"
strTempPath = "\Documents and Settings\" & Environ("USERNAME") & "\Desktop\"

strUserDesktop = Dir(strDrive & strTempPath)

Kill strUserDesktop

FileCopy strSrcePath, strUserDesktop

End Sub


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Desktop Shortcut Tom New Users to Excel 1 October 23rd 06 01:00 AM
Desktop shortcut Greg[_27_] Excel Programming 3 June 26th 06 04:38 AM
how can i get office shortcut bar on the desktop? sath Excel Discussion (Misc queries) 3 June 21st 06 03:31 PM
Place Shortcut On Desktop Paul Moles Excel Programming 4 May 24th 05 10:30 AM
Desktop Shortcut Michael Rekas[_2_] Excel Programming 5 April 27th 04 06:23 PM


All times are GMT +1. The time now is 11:55 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"