Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 50
Default Desktop shortcut

Hi all

Is it possible to have the activeworkbook when it saves for the very first
time to automatically put a shortcut onto the desktop?

I can work out how to have the code activate for the first time, just not
how to get a shortcut to the desktop

Thanks

Greg


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Desktop shortcut

Hi Greg,

I can work out how to have the code activate for the first time, just not
how to get a shortcut to the desktop


Try:

'=============
Public Sub Tester()
Dim WSH As Object
Dim MyShortCut As Object
Dim destPath As String
Dim srcPath As String

srcPath = ThisWorkbook.FullName

Set WSH = CreateObject("WScript.Shell")
destPath = WSH.SpecialFolders.Item("Desktop")

Set MyShortCut = WSH.CreateShortcut(destPath & "\Test.lnk")
With MyShortCut
.TargetPath = srcPath
.Save
End With
Set WSH = Nothing
End Sub
'<<=============


---
Regards,
Norman


"Greg" wrote in message
...
Hi all

Is it possible to have the activeworkbook when it saves for the very first
time to automatically put a shortcut onto the desktop?

I can work out how to have the code activate for the first time, just not
how to get a shortcut to the desktop

Thanks

Greg




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 50
Default Desktop shortcut

Thanks Norman Exactly what I was hoping for

Greg
"Norman Jones" wrote in message
...
Hi Greg,

I can work out how to have the code activate for the first time, just not
how to get a shortcut to the desktop


Try:

'=============
Public Sub Tester()
Dim WSH As Object
Dim MyShortCut As Object
Dim destPath As String
Dim srcPath As String

srcPath = ThisWorkbook.FullName

Set WSH = CreateObject("WScript.Shell")
destPath = WSH.SpecialFolders.Item("Desktop")

Set MyShortCut = WSH.CreateShortcut(destPath & "\Test.lnk")
With MyShortCut
.TargetPath = srcPath
.Save
End With
Set WSH = Nothing
End Sub
'<<=============


---
Regards,
Norman


"Greg" wrote in message
...
Hi all

Is it possible to have the activeworkbook when it saves for the very
first time to automatically put a shortcut onto the desktop?

I can work out how to have the code activate for the first time, just not
how to get a shortcut to the desktop

Thanks

Greg






  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Desktop shortcut


Norman Jones Wrote:
Hi Greg,

I can work out how to have the code activate for the first time, jus

not
how to get a shortcut to the desktop


Try:

'=============
Public Sub Tester()
Dim WSH As Object
Dim MyShortCut As Object
Dim destPath As String
Dim srcPath As String

srcPath = ThisWorkbook.FullName

Set WSH = CreateObject("WScript.Shell")
destPath = WSH.SpecialFolders.Item("Desktop")

Set MyShortCut = WSH.CreateShortcut(destPath & "\Test.lnk")
With MyShortCut
.TargetPath = srcPath
.Save
End With
Set WSH = Nothing
End Sub
'<<=============


---
Regards,
Norman

Hi Norman,
For me, this code does not create a shortcut on the desktop, bu
instead he

C:\Documents and Settings\Owner\Applicatio
Data\Microsoft\Office\Recent

Why is that

--
Desert Piranh

-----------------------------------------------------------------------
Desert Piranha's Profile: http://www.excelforum.com/member.php...fo&userid=2893
View this thread: http://www.excelforum.com/showthread.php?threadid=55314

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
Desktop Shortcut Tom New Users to Excel 1 October 23rd 06 01:00 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
Sending a shortcut to the desktop Paul Excel Discussion (Misc queries) 1 February 21st 05 08:06 PM
Desktop Shortcut Michael Rekas[_2_] Excel Programming 5 April 27th 04 06:23 PM


All times are GMT +1. The time now is 11:46 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"