How to read open excel file at C#

前端 未结 6 2113
北海茫月
北海茫月 2020-12-17 16:47

I want to read already open excel file with C#. I am using this method but it can\'t read the excel file while the file is open in Microsoft excel.

FileStre         


        
6条回答
  •  再見小時候
    2020-12-17 17:36

    To ensure that correct opening and closing of the file please look at using the c# using statements

    using (FileStream stream = File.Open("myfile.xlsx", FileMode.Open, FileAccess.Read)) 
    {
    
    }
    

提交回复
热议问题