我想用C#读取已打开的excel文件.我正在使用此方法,但它在Microsoft Excel中打开文件时无法读取excel文件.
FileStream stream = File.Open("myfile.xlsx", FileMode.Open, FileAccess.Read);
Run Code Online (Sandbox Code Playgroud)
它给 IOException: The process cannot access the file 'myfile.xlsx' because it is being used by another process.
我希望你明白我的意思.我想保持excel文件打开,当文件在Microsoft Excel打开时,我想从C#中读取它.我正在使用C#net framework 4.0