需求背景:在一些以数据为核心竞争力的行业或企业软件中,我们经常会碰到这样的需求,需要在Excel里直接拉取远程相关的业务数据,比如财汇等都提供了类似的功能,这类技术叫Excel add-ins
实现目标:在Excel中嵌入自定义工具栏,并完成远程数据拉取操作,如下图:
其中:刷新数据,拉取数据,关于这三个菜单是自定义的
开发步骤:
- 利用VC++或Delphi之类的桌面开发工具完成Excel Addins的功能开发,以Delphi为例
- 编写提取远程数据的接口,可以是Web Service或Rest接口,这里采用Rest接口
- Delphi代码编写,核心的代码片段如下:
提取Excel当前选中单元格:
function TAddInModule.CheckSelection: boolean;
var
Intf: IDispatch;
IWks: Excel2000._Worksheet;
begin
Result := ExcelApp.Workbooks.Count > 0;
if Result then begin
Intf := ExcelApp.ActiveSheet;
Intf.QueryInterface(Excel2000._Worksheet, IWks);
Result := Assigned(IWks);
end;
end;
测试单元格内容:
IRange.Cells.Value := gjkCode;
下一行单元格:
cCell.Item[2,1] := sValue;
- 大小: 7.3 KB
分享到:
相关推荐
Excel Add-Ins(C#例子) Excel Add-Ins(C#例子)
Devart Excel Add-ins 将 Excel 的全部功能用于您的云或数据库数据 将 Microsoft Excel 连接到各种数据源 直接在 Excel 中处理实时数据 轻松修改外部数据
how-to-use-excel-add-ins-in-the-spreadsheet-control-e5012-13.2.5-
IBM Database Add-Ins for Visual Studio
A description about Add-ins. Add-in structures. Add-in problems. Add-in design and implementation.
Excel Add-in开发资料 包括Ribbon、imgso说明
Microsoft Excel Add-In Microsoft Excel Add-In Microsoft Excel Add-In Microsoft Excel Add-In
VB下插件(Add-Ins)编程[VB下插件(Add-Ins)编程]-精品源代码
creating powerful and reliable add-ins for Excel. With years of use, many people build up the experience and understanding needed to create custom functions for Excel in C and C++. However, given the ...
For those developing add-ins in C and C++ so little changed between Excel 97 and Excel 2003 (version 11) that the entire first edition applied almost equally to versions 8, 9, 10 and 11. Excel 2007 ...
net macros and add-ins的发展net macros and add-ins的发展net macros and add-ins的发展
支持的条码类型,其中有常见的39码<BR> - CODABAR (MONARCH)<BR> - CODE 11<BR> - CODE 128<BR> - CODE 16K<BR> - CODE 39 (standard and extended)<BR> - CODE 93<BR> - EAN1-28<BR> - EAN-13<BR> - EAN-8<BR> - ...
开发excel add in 很好的一本书,是学习excel 进阶的 非常不错的资料
TD插件,用于excel打开tdms文件,经测试office2013可用,请放心下载
该软件包包含:Excel表分析工具、Excel数据挖掘客户端和Visio数据挖掘模板。
HP_Quality_Center_10_00_Microsoft_Excel_Add-in用于导入Excel测试用例到ALM中
Reflector 5.0 Add-Ins.rar qq:292258449 反编译工具Reflector 5.0插件共计26个.
如何为vs写插件。..
该软件包包含3个插件:Excel表分析工具、Excel数据挖掘客户端和Visio数据挖掘模板。 运行Analysis Services后,就可以安装该插件了。
Calling Add-ins of solidworks PDM