Wait for Workbook.RefreshAll() (C#)

前端 未结 4 764
伪装坚强ぢ
伪装坚强ぢ 2021-01-18 15:50

I want to loop through a directory (using C#) and Refresh all Excel sheets in there. I use:

Workbook.RefreshAll();

How can I wait for the <

4条回答
  •  南方客
    南方客 (楼主)
    2021-01-18 16:28

    Updated 31.05.2016...

    Thanks for your help. I found the following solution:

    foreach (MSExcel.WorkbookConnection cnn in wb.Connections)
    {
        if (cnn.Type.ToString() == "xlConnectionTypeODBC")
        {
            cnn.ODBCConnection.BackgroundQuery = false;
        }
        else
        {
            cnn.OLEDBConnection.BackgroundQuery = false;
        }
    }
    

    Frank

提交回复
热议问题