在excel里做了很多超链接,而且链接的
都是本地的相对
路径文件,可惜不知怎么的,它会自动变成绝对路径,这样就引起访问时找不到
正确路径,故通过VBA批
处理的
方法把它全部改回来,如下: Dim oldfile As String Dim Newfile As String Sub RemoveHyperLinks() oldfile = "D:AdministratorApplication DataMicrosoftExcel" '需要
替换的旧文件名 Newfile = "" '替换成的新文件名 For Each hlink In Cells.Hyperlinks hlink.Address = Replace(hlink.Address, oldfile, Newfile) Next End Sub