获取共享文件夹中所有音频文件的超链接列表

发布于 2025-02-07 21:28:21 字数 1365 浏览 1 评论 0原文

我在音频上工作。 我想创建一个Excel电子表格,该电子表格将目录中的所有音频文件输入使用超链接的列表,因此我们可以快速参考每个曲目,并在电子表格中的其他列上添加注释和评论。 我们所有的文件都存储在Sync上,这是一个类似于Dropbox或Google Drive的共享文件夹系统。

我已经成功地在线找到了以下VBA代码:

Sub listfiles()
Updateby Extendoffice
    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

问题是,即使目录是共享文件夹的目录,我团队的其他成员也无法使用电子表格,因为目录在开始时包含特定信息我的电脑。

因此,我考虑解决此问题的两种方法:

  1. 将路径分为两个部分:个人系统路径 +共享文件夹路径 程序是否可以分开询问这些问题,并将两者都附加到全局路径中,以便将其避免另一个没有正确路径的用户的错误? Se我们将有一个“获取本地路径”部分,一个“仅获取共享文件夹路径”部分,然后是一个额外的步骤,总路径将是“本地路径 +共享文件夹路径”。

  2. 无论用户的本地共享文件夹,同步文件也存在于线。是否可以在VBA中作为目录输入共享文件夹的在线链接并通过文件梳理并以相同的方式获取超链接列表?

我没有看到一个更简单,更优雅的解决方案吗?

此外,如果该电子表格在每次上传新文件时都可以自动更新自动更新,则该电子表格将是最佳的。 我愿意使用除VBA以外的其他内容,我不知道该语言,但是我确实以一种非常基本的方式知道Python。

非常感谢您提供的任何帮助,

Dany

I work in audio.
I would like to create an excel spreadsheet that takes all audio files in a directory and outputs them into a list with hyperlinks, so we can quickly reference each tracks and add notes and comments on other columns in the spreadsheet.
All our files are stored on Sync, a shared folder system akin to Dropbox or Google Drive.

I've succeeded with the following VBA code, found online:

Sub listfiles()
Updateby Extendoffice
    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

The problem is that even though the directory is that of a shared folder, other members of my team can't use the spreadsheet since the directory contains specific information at the beginning pertaining to my PC.

So there are two ways I was thinking of fixing this:

  1. To split the path in two parts : Personal System path + Shared Folder path
    Would it be possible for the program to ask these separatly and just append both into a global path so that way it would circumvent the error of another user not having the correct path ? Se we'd have a "get local path" part, a "get only shared folder path" part and then an extra step where the total path would be "local path + shared folder path".

  2. The Sync Files also exist online, irrespective of the user's local shared folder. Would it be possible to enter as a directory in VBA the online link of the shared folder and comb through the files and get the hyperlink list in the same way ?

Is there a simpler, more elegant solution to it that I'm not seeing ?

Furthermore, if there was a way for that spreadsheet to automatically update itself each time a member of the team uploads a new file, it would be optimal.
I'm open to using something else than VBA, I don't know the language, however I do know python in a very basic way.

Thank you so much for any help you can provide,

Dany

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文