Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/excel/25.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# excel文件的自动更新程序_C#_Excel_Automation_Vba - Fatal编程技术网

C# excel文件的自动更新程序

C# excel文件的自动更新程序,c#,excel,automation,vba,C#,Excel,Automation,Vba,我为我编写的一些软件定制了一个自动更新程序。该软件由多个DLL和.xLA文件组成。目前,我的自动更新程序的工作原理如下所示 1) Check server to see if update is available 2) download new DLLs and .xla file to temp folder when update is available 3) rename old DLLs and .xla file example: a.dll -> a_old.dll

我为我编写的一些软件定制了一个自动更新程序。该软件由多个DLL和.xLA文件组成。目前,我的自动更新程序的工作原理如下所示

1) Check server to see if update is available
2) download new DLLs and .xla file to temp folder when update is available
3) rename old DLLs and .xla file
   example: a.dll -> a_old.dll
            b.dll -> b_old.dll
            c.xla -> c_old.xla
4) Move new DLLs and .xla file to install location

步骤3和4是关键。我重命名了旧的DLL,因为一些当前运行的程序可能有一个句柄。重命名可确保运行的程序不受影响,并将继续使用旧版本的DLL,而新启动的实例将使用新的DLL。除了XLA文件之外,这很好。当XLA文件在微软Excel中打开时,不允许重命名操作。你有什么想法我可以绕过这个问题,或者你对我的更新者应该如何处理Excel文件的更新有什么建议?

< P>我认为如果你把XLA文件标记为“只读”它不会被锁定。它不会被锁上。@TimWilliams-工作起来很有魅力,让我感到羞怯,因为回想起来很明显,我忘了检查它。你能重新键入你的评论作为回答吗?这样我就可以接受了?非常感谢你的帮助。不要担心不去想它——当我遇到同样的问题时,我不得不让别人给我建议。。。