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: 247
Default create shortcut but not for active workbook

i got the following code to save a copy of the workbook. I tried to add a
"create shortcut" but it makes the shortcut for the activeworkbook and not
the copy of the workbook...

########################***####################### ####

ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True

ActiveSheet.Protect Password:=""



Dim bErr As Boolean
On Error Resume Next
MkDir "c:\maykent"
MkDir "C:\maykent\stocksheet"
bErr = (Err.Number < 0)
On Error GoTo 0
If bErr Then
If Dir("C:\maykent\stocksheet\LAST WEEK stocksheet.xls") < "" Then




ThisWorkbook.SaveCopyAs "C:\maykent\stocksheet\LAST WEEK stocksheet.xls"


CreateShortCut thisworkbook
###########################***#################### ####

&

##########################***##################### ####

Sub CreateShortCut(bk As Workbook)
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 & "\" & _
bk.Name & ".lnk")
With oShortcut
.TargetPath = bk.FullName
.Save
End With
Set oWSH = Nothing


End Sub

#######################***######################## ####
--
Helpful advice on posting to newsgroups here...
http://www.cpearson.com/excel/newposte.htm
 
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
Shortcut key for displaying the active cell comment Tonso Excel Discussion (Misc queries) 3 July 22nd 06 09:11 PM
How to e-mail a shortcut to the active workbook quartz[_2_] Excel Programming 1 April 3rd 05 11:31 PM
email shortcut to active workbook as an outlook attachment Neil Deinhardt Excel Programming 0 September 28th 04 08:14 PM
Call macro from active workbook-duplicate shortcut keys James[_18_] Excel Programming 1 January 16th 04 05:53 PM
Shortcut to toggle active Worksheet m Shane Excel Programming 2 December 27th 03 09:15 PM


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