我需要这个VBA来提取所有文件名,链接它们并将它们放在A2列中并以+1为增量向下
Sub GetFileNamesInfolder()
Dim FSO As Object
Dim Folder As Object
Dim File As Object
Dim Path As String
Dim A As Integer
Path = "\\server5\Operations\MainBoard testing central location DO NOT REMOVE or RENAME"
Set FSO = CreateObject("Scripting.FileSystemObject")
Set Folder = FSO.GetFolder(Path)
For Each File In Folder.Files
A = A + 1
ActiveSheet.Hyperlinks.Add Cells(A, 1), File.Path, , , File.Name
Next
End Sub
你会怎么做?