ich habe folgendes Makro gefunden:
Sub CreateShortcut()
Dim objShell As Object
Dim objFolder As Object
Dim objFItem As Object
Dim objScriptHost As Object
Dim objShortcut As Object
Dim strShortcutPath As String
Dim strShortcutName As String
Dim strXLFilename As String
On Error Resume Next
Set objShell = CreateObject("Shell.Application")
Set objFolder = _
objShell.BrowseForFolder _
(0, "Wo soll die Verknuepfung erstellt werden?", 0)
If objFolder Is Nothing Then Exit Sub
On Error GoTo CrSh_Error
Set objFItem = objFolder.Self
strShortcutPath = objFItem.Path
If ActiveWorkbook.Path "" Then
Set objScriptHost = CreateObject("Wscript.Shell")
strXLFilename = ActiveWorkbook.Name
strShortcutName = _
Left(strXLFilename, _
InStr(1, strXLFilename, ".xl"))
Set objShortcut = _
objScriptHost.CreateShortcut _
(strShortcutPath & "\" & _
strShortcutName & ".lnk")
With objShortcut
.TargetPath = ActiveWorkbook.FullName
.Save
End With
MsgBox "Verknuepfung wurde erstellt."
Else
MsgBox "Sie muessen die Arbeitsmappe erst speichern." & _
vbCr & "Aktion wird abgebrochen..."
End If
CrSh_End:
Set objShortcut = Nothing
Set objFItem = Nothing
Set objFolder = Nothing
Set objShell = Nothing
Set objScriptHost = Nothing
Exit Sub
CrSh_Error:
MsgBox "Fehler beim Erstellen der Verknuepfung"
Err.Clear
Resume CrSh_End
End Sub
Das Makro erstellt für eine Excel-Datei einen ShortCut, leider zeigt es aber auch eine Auswahlliste zum Speichern des Shortcuts an. Ich möchte jedoch den Shortcut nur auf dem "Desktop" angezeigt bekommen, also fest vorgegeben! Was ist zu ändern? Wer hat einen Tipp?
Schönen Tag noch
Walburga