如何更新两个单独的Excel工作簿? [英] How do i keep two separate excel workbooks updated?

查看:108
本文介绍了如何更新两个单独的Excel工作簿?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在从excel文件中读取以在gridview中显示信息。不幸的是,这个文件必须保持关闭才能让我阅读它。更不幸的是,它是一个不断被打开以进行更新的文件。欢迎任何建议。



谢谢



我的尝试:



我研究创建一个宏但我无法让它工作。而且我很确定必须更新此文件的人不会熟悉宏。

I am reading from an excel file to display information in a gridview. Unfortunately, this file has to remain closed in order for me to read it. And even more unfortunately, it is a file that is constantly being opened to be updated. Any advice will be welcomed.

Thanks

What I have tried:

I looked into creating a macro but I was unable to get that to work. And Im pretty sure the people who will have to update this file will not be familiar with macros.

推荐答案

你别无选择,只能打开它,或制作副本它并打开副本。在任何一种情况下,在您的代码读取期间或在复制操作期间,该文件都不可用于更新。



真正的解决方案是不使用Excel工作表作为一个数据库。使用真正的数据库引擎,如果需要在Excel中操作数据,请使用Excel的数据功能从数据库加载数据,该功能可以从SQL数据库导入。
You have no choice but to open it, or make a copy of it and open the copy. In either case, the file will be unavailable for update during the read by your code or during the copy operation.

The real solution is to NOT use an Excel sheet as a database. Use a real database engine and if you need to manipulate the data in Excel, load it from the database using Excel's data functionality, which can import from an SQL database.


这篇关于如何更新两个单独的Excel工作簿?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆