Hallo zusammen,
ich quäle mich schon seit Tagen und kriege es leider nicht hin, dass die Hyperlink-Adresse der Zelle erkannt wird, sodass die geöffnete Datei auf dem Desktop gespeichert wird... Vielleicht könnte mir ja einer von Euch helfen :) Vielen Dank schon mal im Voraus!
Liebe Grüsse
Katerina
PS.: hier mein Code
Dim FSO As Object
Dim FromPath As String
Dim ToPath As String
Dim sText As String
Dim SLink As String
sText = Selection.Value
SLink = Selection.Hyperlinks(1).Address
FromPath = "SLink"
ToPath = "H:\Desktop\Temp"
If Right(FromPath, 1) = "\" Then
FromPath = Left(FromPath, Len(FromPath) - 1)
End If
If Right(ToPath, 1) = "\" Then
ToPath = Left(ToPath, Len(ToPath) - 1)
End If
Set FSO = CreateObject("scripting.filesystemobject")
If FSO.FileExists(FromPath) = False Then
MsgBox FromPath & " doesn't exist"
Exit Sub
End If
FSO.CopyFilr Source:=FromPath, Destination:=ToPath
MsgBox "You can find the files and subfolders from " & FromPath & " in " & ToPath
|