简体   繁体   English

C# 从打开的 Excel 文件中读取数据

[英]C# Read Data from Open Excel File

Using C# Selenium, how would I read/write data from an Excel file that is already open on the user's machine?使用 C# Selenium,我将如何从用户机器上已经打开的 Excel 文件中读取/写入数据? I've searched the other answers here and only see how to open the Excel and start reading.我在这里搜索了其他答案,只看到如何打开 Excel 并开始阅读。 Am I able to connect to a file that is already open and read/write to it?我是否能够连接到已打开的文件并对其进行读/写? In my case I would know the exact file name just not the file location.就我而言,我会知道确切的文件名而不是文件位置。

If you open your File-Explorer and go into the Folder of the Excel-File you will see a lock-File when one other user has opened the Document.如果您打开文件资源管理器并进入 Excel 文件的文件夹,当其他用户打开文档时,您将看到一个锁定文件。 This will be on all Office Documents.这将出现在所有 Office 文档上。

In normal mode only one (the first) User can open a Office Document and write in it.在正常模式下,只有一个(第一个)用户可以打开 Office 文档并在其中写入。 So no other User can write ...所以没有其他用户可以写......

But there will be a Function that allowes multiple-Users to work in the same time on one Office Document.但是会有一个功能允许多个用户同时在一个 Office 文档上工作。 So multiple User can open and do changes over the day.因此,多个用户可以在一天内打开并进行更改。 It will update for a single User directly on save with the modifications from the other Users.它将在保存时直接更新单个用户,并使用其他用户的修改。

I dont know the english name of this function, but it should be something like -Approve Document-我不知道这个函数的英文名称,但它应该类似于 -Approve Document-

Maybe this link will be helpfull ... It is in german and you can translate it.也许这个链接会有所帮助......它是德文的,你可以翻译它。

Excel-Freigeben-Zusammenarbeiten Excel-Freigeben-Zusammenarbeiten

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM