Excel 当 Dropbox 运行 时,工作簿自定义出现“进程无法访问文件,因为它正在被另一个进程使用”

Excel workbook customization is getting “Process can’t access file because it is being used by another process” when Dropbox is running

我有一个 Excel 加载项项目,我在打开工作簿后立即向工作簿添加自定义。

                       // check if the file is readonly.
                       FileInfo f = new FileInfo(fullName);
                       bool isReadOnly = f.IsReadOnly;
                       f.IsReadOnly = false;

                        string[] nonpublicCachedDataMembers = null;

                        bool runAsLocal = !(ApplicationDeployment.IsNetworkDeployed);

                        ServerDocument.AddCustomization(fullName,
                                                        assemblyLocation,
                                                        SolutionID,
                                                        codeBaseEnv,
                                                        runAsLocal,
                                                        out nonpublicCachedDataMembers);

                        f.IsReadOnly = isReadOnly;

我在将自定义项添加到工作簿时收到一条错误消息,提示“进程无法访问文件,因为它正被另一个进程使用”。只有当“Dropbox”在后台 运行 时才会发生这种情况(文件未保存在 Dropbox 文件夹中并且防病毒软件已关闭)。我知道发生这种情况是因为文件正在被多个进程访问。除了在我进行工作簿自定义时停止 Dropbox 之外,这种情况是否存在任何已知问题或任何解决方法?

感谢这方面的任何支持。

我能够通过禁用 Dropbox 标志加载我的工作簿自定义。但仍然不知道哪个进程可能会阻塞 Excel.

参考:Dropbox forum answer