我运行一个线程,每隔5分钟自动保存excel文件。保存时,保存文件(fileA)将被激活。同时,我正在编辑其他文件(fileB)。 当我使用fileB时如何在后台保存fileA? 这是我在线程中的C#代码:
<div class="col-lg-2 pictures_titles" >
<img class="team_img" src="../assets/img/Website-Png/About-Us-01-3.png">
<br><br>
<div class="name_titles">
<span id="namess" style="color:white;"><p> JAMES WILLIAMS </p></span>
<br>
<span id="storys1" style="color:white;">
<p> An experienced strategist and entrepreneur, he is the Founder and Managing Director
of gorb.</p> </span>
</div>
</div>
答案 0 :(得分:0)
试试这个。
wbook.SaveAs("c:\\temp\\blah", Microsoft.Office.Interop.Excel.XlFileFormat.xlWorkbookDefault, Type.Missing, Type.Missing,
false, false, Microsoft.Office.Interop.Excel.XlSaveAsAccessMode.xlNoChange,
Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing);
wbook.Close();
或者,将此片段的VBA代码放在ThisWorkbook Module中。
Private Sub Workbook_Open()
Application.OnTime Now + TimeValue("00:05:00"), "SaveThis"
End Sub