简体   繁体   English

实施Excel外部数据源

[英]Implementing an Excel External Data source

Is there any way to implement a custom data source that works with the "Import External Data" feature? 有什么方法可以实现与“导入外部数据”功能一起使用的自定义数据源?

Let's say I have data in a file format that Excel doesn't understand. 假设我拥有Excel无法识别的文件格式的数据。 I'd like to implement an add-in (or whatever) for Excel that allows it to understand this format through the "External Data" feature. 我想为Excel实现一个外接程序(或其他任何程序),以使其能够通过“外部数据”功能来理解这种格式。 Obviously, I could just convert the file to something Excel already understands but, for the sake of user friendliness, I'd rather not have this additional step. 显然,我可以将文件转换为Excel已经可以理解的格式,但是为了方便用户使用,我宁愿不要执行此附加步骤。

I ended up creating a service that runs an HTTP server on localhost that serves up tab-delimited data. 我最终创建了一个服务,该服务在localhost上运行HTTP服务器,该服务器提供制表符分隔的数据。 It was dead simple to develop and fits my needs perfectly. 开发非常简单,完全可以满足我的需求。 It integrates with the External Data feature with no need to develop an ODBC driver. 它与外部数据功能集成,无需开发ODBC驱动程序。

An add-in (or whatever) here would be an ODBC driver (or an OLEDB driver). 这里的外接程序(或其他程序)将是ODBC驱动程序(或OLEDB驱动程序)。 I think you don't want to write one. 我想你不想写一个。

That's the case if you want to use Import External Data, but you can, of course, create an add-in which would parse and load the file on it's own. 如果要使用“导入外部数据”,就是这种情况,但是您当然可以创建一个加载项,该加载项将自行解析和加载文件。 It will have it's own menu item then and will not be related with Import External Data. 然后它将具有其自己的菜单项,并且将与“导入外部数据”无关。

You could try XLLoop . 您可以尝试XLLoop This lets you implement excel functions (UDFs) on an external server. 这使您可以在外部服务器上实现excel函数(UDF)。

So your spreadsheet could contain a function called LoadWidgetData(widgettype, date), which would call your server. 因此,电子表格可以包含一个名为LoadWidgetData(widgettype,date)的函数,该函数将调用您的服务器。

There are server implementations in many languages (Java, Ruby, Python, PHP). 有多种语言(Java,Ruby,Python,PHP)的服务器实现。

BTW, I work on the project so let me know if you have any questions. 顺便说一句,我正在做这个项目,所以如果您有任何问题,请告诉我。

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

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