I am looking to create a process that opens several excel files and just updates them. I have a code:
excel.Visible = true;
Microsoft.Office.Interop.Excel.Workbook workbook = excel.Workbooks.Open("Testfile.xlsx");
workbook.RefreshAll();
workbook.Save();
The problem is that since on these sheets the connections are established for the update in the background, which it tries to save before it completes the update. I know that I need to set BackgroundQuery = false, but I do not know how to access existing connections. Any help is appreciated.
source
share