如何编写Excel 2013的电子表格比较? [英] How to script Excel 2013's Spreadsheet Compare?

查看:147
本文介绍了如何编写Excel 2013的电子表格比较?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试纳入新的电子表格比较功能从Excel 2013的查询加载项到VBA脚本。

I'm trying to incorporate the fancy new Spreadsheet Compare function from Excel 2013's Inquire Add-in, into a VBA script.

计划是要一个宏,用于自动比较具有预定义名称的两个电子表格,并将所有差异导出为新的电子表格。

The plan is to have a macro to automate comparison between two spreadsheets with predefined names, and to export all the differences as a new spreadsheet.

没有成功,到目前为止。

Without success, to date.

这是我迄今为止所尝试的:

Here's what I've tried so far:


  1. 通常,要了解如何自动化一些Excel功能,我使用记录宏。

  2. 如果失败了,我看看可以添加的引用列表,看看我是否缺少一些明显的东西。



    在这种情况下,这两个都失败了。当我记录一个宏(只有外围的东西像单元格选择出现)时,没有代码显示与电子表格比较相关。而且没有一个可添加的引用看起来像是电子表格比较。

Both of those have failed in this case. No code appeared relevant to the Spreadsheet Compare, when I recorded a macro (only the peripheral stuff like cell-select appeared). And none of the addable references looked anything like Spreadsheet Compare.

那么如何从VBA脚本Excel的2013电子表格比较?

So how can I script Excel's 2013 Spreadsheet Compare, from VBA?

推荐答案

我打开了一个类似的问题,用于从.NET应用程序自动化电子表格比较工具,但是我还没有找到任何其他方法来执行命令行。

I opened a similar question for automating the Spreadsheet Compare tool from a .NET application, but I haven't found any other way yet than executing it from command-line.

您可以从VBA加载项中执行此操作。所有你需要的是找到可执行文件SPREADSHEETCOMPARE.EXE(通常在C:\Program文件(x86)\ Microsoft Office\Office15\DCF),并在命令行中执行它与指令文件作为输入参数。

You can do this from your VBA add-in. All you need is to locate the executable file SPREADSHEETCOMPARE.EXE (usually in C:\Program Files (x86)\Microsoft Office\Office15\DCF) and to execute it in command-line with an instruction file as input argument.

这个指令文件必须是一个ASCII文件,其中两条Excel文件路径可以分开比较。

This instruction file must be an ASCII file with the two Excel file paths to compare written in separate lines.

这篇关于如何编写Excel 2013的电子表格比较?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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