我有一些代码旨在通过覆盖主文件和覆盖可访问网络位置上的写保护副本来打开本地主文件、进行添加和保存文件。这是通过将修改后的文件保存到临时文件然后复制其他两个文件来完成的。StringtempFileName="File.tmp";StringfileName="File.xlsm";StringserverPath="\\\\networkpath\\";FileserverFile=newFile(serverPath+fileName);Files.copy(Paths.get(tempFileName),Paths.get(fileName),StandardCopyOption.