Hello guys,
Im looking for help with VBA. Im working on excel table showing our parts with hyperlink to its path, that I managed do figure out with some simple commands, but now comes the issue. I can get list of parts with hyperlinks to its .RAR files, I need some walkaround so I can drag and drop those fields with hyperlinks and make a copy of them in specific folder or to attach it to outlook message. If not drag and drop, then somehow mark some of them and then run a command that make a copy of rar files in hyperlink and rar to specific folder or again outlook message.
Please can you help me?
Sub Example1()
Dim xFSO As Object
Dim xFolder As Object
Dim xFile As Object
Dim xFiDialog As FileDialog
Dim xPath As String
Dim I As Integer
Set xFiDialog = Application.FileDialog(msoFileDialogFolderPicker)
If xFiDialog.Show = -1 Then
xPath = xFiDialog.SelectedItems(1)
End If
Set xFiDialog = Nothing
If xPath = "" Then Exit Sub
Set xFSO = CreateObject("Scripting.FileSystemObject")
Set xFolder = xFSO.GetFolder(xPath)
For Each xFile In xFolder.Files
I = I + 1
ActiveSheet.Hyperlinks.Add Cells(I, 1), xFile.Path, , , xFile.Name
Next
End Sub
this will enlist Name of those parts with hyperlink to .rar file that contains pdf and step file.
Bookmarks