Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 203
Default Help with error code

Good day all, i am creating a shortcut with the code below and now need
to check if this has been created previously or not and if it has branch
to other code. Could somebody please help me out of my misery as i am
not sure how to do it.

ChDrive "C:"
Dim oWSH As Object
Dim oShortcut As Object
Dim sPathDeskTop As String
Set oWSH = CreateObject("WScript.Shell")
sPathDeskTop = oWSH.SpecialFolders("Desktop")
Set oShortcut = oWSH.CreateShortCut(sPathDeskTop & "\" & _
ActiveWorkbook.Name & ".lnk")
With oShortcut
.TargetPath = ActiveWorkbook.fullName
.IconLocation = "\\nv09002\tpdrive\TM-Recon\macro\scale.ico"
.Save
End With
Set oWSH = Nothing




Tempy

*** Sent via Developersdex http://www.developersdex.com ***
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Help with error code

See your other thread.

Tempy wrote:

Good day all, i am creating a shortcut with the code below and now need
to check if this has been created previously or not and if it has branch
to other code. Could somebody please help me out of my misery as i am
not sure how to do it.

ChDrive "C:"
Dim oWSH As Object
Dim oShortcut As Object
Dim sPathDeskTop As String
Set oWSH = CreateObject("WScript.Shell")
sPathDeskTop = oWSH.SpecialFolders("Desktop")
Set oShortcut = oWSH.CreateShortCut(sPathDeskTop & "\" & _
ActiveWorkbook.Name & ".lnk")
With oShortcut
.TargetPath = ActiveWorkbook.fullName
.IconLocation = "\\nv09002\tpdrive\TM-Recon\macro\scale.ico"
.Save
End With
Set oWSH = Nothing

Tempy

*** Sent via Developersdex http://www.developersdex.com ***


--

Dave Peterson
Reply
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
error in code des-sa[_2_] Excel Discussion (Misc queries) 5 July 3rd 08 08:09 AM
How can I still go to the error-code after a On Error Goto? Michel[_3_] Excel Programming 2 May 4th 04 04:21 AM
Code Error - Run Time Error 5 (Disable Cut, Copy & Paste) Tim[_36_] Excel Programming 4 April 23rd 04 02:53 AM
More to Error in code Julie Excel Programming 4 November 4th 03 06:10 PM
Error code=2 Derek[_5_] Excel Programming 1 October 14th 03 12:41 PM


All times are GMT +1. The time now is 11:39 PM.

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"