Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
Francesco
 
Posts: n/a
Default HELP for a macro to create a shortcut of an excel file on the desk


Hello

Using windowsXP Prof. and excel 2003

Is there a way to create a shortcut of an excel file on the Desktop using a
macro?
If yes, can anyone tell me how?
Thanks
Francesco
  #2   Report Post  
Posted to microsoft.public.excel.misc
Bob Phillips
 
Posts: n/a
Default HELP for a macro to create a shortcut of an excel file on the desk

'----------------------------------------------------------------
Sub CreateShortCut()
'----------------------------------------------------------------
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
.Save
End With
Set oWSH = Nothing

End Sub


--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"Francesco" wrote in message
...

Hello

Using windowsXP Prof. and excel 2003

Is there a way to create a shortcut of an excel file on the Desktop using

a
macro?
If yes, can anyone tell me how?
Thanks
Francesco



  #3   Report Post  
Posted to microsoft.public.excel.misc
Francesco
 
Posts: n/a
Default HELP for a macro to create a shortcut of an excel file on the

Thanks a lot Bob it works fine
Regards
Francesco

"Bob Phillips" wrote:

'----------------------------------------------------------------
Sub CreateShortCut()
'----------------------------------------------------------------
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
.Save
End With
Set oWSH = Nothing

End Sub


--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"Francesco" wrote in message
...

Hello

Using windowsXP Prof. and excel 2003

Is there a way to create a shortcut of an excel file on the Desktop using

a
macro?
If yes, can anyone tell me how?
Thanks
Francesco




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
Excel Outlook Attachments opening after several errors everytime cito_support Setting up and Configuration of Excel 2 March 13th 06 06:15 PM
I need a shortcut to make a excel file open to a specific sheet EAHRENS Excel Discussion (Misc queries) 9 December 6th 05 06:51 PM
Urgent Help Required on Excel Macro Problem Sachin Shah Excel Discussion (Misc queries) 1 August 17th 05 06:26 AM
Unable to create any link/hyperlinks in a particular excel file Nabanita Excel Discussion (Misc queries) 0 June 21st 05 11:52 AM
How to I create a pdf file from Word or Excel files stolitx Excel Discussion (Misc queries) 4 December 28th 04 07:17 PM


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