excel中运行dod命令_从Excel更新运行命令文件

excel中运行dod命令

Last year, J. Woolley shared his technique to run command files from Excel hyperlinks. He has improved how this works, and now you can get his latest version of the files. It has a SuperLink function too, that is better than Excel's HYPERLINK function.

去年,J。Woolley分享了他从Excel超链接运行命令文件的技术。 他改进了它的工作方式,现在您可以获取文件的最新版本。 它还具有SuperLink功能,比Excel的HYPERLINK功能要好。

从Excel原始运行命令文件 (Original Run Command Files From Excel)

Click here to see the original article, that describes how the first version works, and why J. Woolley created it, to make it easy to run command files from Excel.

单击此处以查看原始文章 ,该文章描述了第一个版本的工作方式以及J. Woolley创建它的原因,从而使从Excel运行命令文件变得容易。

新版和改进版 (New and Improved Version)

Since I posted that article, J. Wooley has made significant improvements to this technique. For example:

自从我发表该文章以来,J。Wooley对该技术进行了重大改进。 例如:

  • RUN::COMMAND can be included in a hyperlink cell's text value or in its ScreenTip (or both)

    RUN :: COMMAND可以包含在超链接单元格的文本值或它的ScreenTip(或两者)中

  • Multiple RUN::COMMANDs can be processed for a single hyperlink cell

    可以为单个超链接单元格处理多个RUN :: COMMAND

  • Defining the path for each RUN::COMMAND is now simplified

    现在简化了定义每个RUN :: COMMAND的路径

J. Wooley also developed a new user-defined function (UDF) named SuperLink. This function supports RUN::COMMAND , and it can be used independently too, as a better way to create hyperlinks. (The SuperLink UDF details are described further down in this article.)

J. Wooley还开发了一个名为SuperLink的新用户定义函数(UDF)。 该函数支持RUN :: COMMAND ,它也可以独立使用,作为创建超链接的更好方法。 (SuperLink UDF的详细信息将在本文的下面进一步介绍。)

获取运行命令文件 (Get the Run Command Files)

To get started, click this link to get the zipped folder with the Run Command files, and download it to a folder on your computer. RunCommand.zip contains the following files:

首先,请单击此链接以获取带有“运行命令”文件的压缩文件夹 ,并将其下载到计算机上的文件夹中。 RunCommand.zip包含以下文件:

  • TestRunCommand.xlsm

    TestRunCommand.xlsm
  • Simple.vbs

    简单的.vbs
  • Simple.cmd

    简单的.cmd
  • UseRunCommand.pdf

    UseRunCommand.pdf
  • UseSuperLink.pdf

    UseSuperLink.pdf
  • ExcelBugReport.pdf

    ExcelBugReport.pdf
  • M_ProcessRunCommand.bas

    M_ProcessRunCommand.bas
  • M_SuperLink.bas

    M_SuperLink.bas

安装运行命令文件 (Install the Run Command Files)

First, before you unzip the file, you will probably need to unblock the downloaded file using its Properties dialog box.

首先, 在解压缩文件之前 ,您可能需要使用其“属性”对话框取消阻止下载的文件

If you don't unblock the file, the RUN::COMMAND technique might appear to work, but it will not work correctly.

如果您不取消阻止文件,则RUN :: COMMAND技术可能会起作用,但不会正确起作用

Then, after the downloaded file is unblocked, unzip all files to a single folder. The TestRunCommand.xlsm workbook assumes it is in the same folder as the other files.

然后,解除阻止下载的文件后,将所有文件解压缩到一个文件夹中。 TestRunCommand.xlsm工作簿假定它与其他文件位于同一文件夹中。

使用运行命令文件 (Use the Run Command Files)

After the files are unzipped, open TestRunCommand.xlsm in Excel; you will probably need to Enable Content for Macros.

解压缩文件后,在Excel中打开TestRunCommand.xlsm。 您可能需要为宏启用内容。

  • NOTE: The files named M_ProcessRunCommand.bas and M_SuperLink.bas have already been imported as VBA Modules. in TestRunCommand.xlsm

    注意:名为M_ProcessRunCommand.baM_SuperLink.bas的文件已作为VBA模块导入。 在TestRunCommand.xlsm中

On the Tests sheet, there is an explanation in cells C1:D6 and there are 3 columns with hyperlinks:

在“测试”表上,单元格C1:D6中有一个解释,并且有3列带有超链接:

  • B – Standard Hyperlinks

    B –标准超链接
  • C – links created with Excel's HYPERLINK function

    C –使用Excel的HYPERLINK函数创建的链接
  • D – Standard hyperlinks with RUN::Commands

    D –带有RUN :: Commands的标准超链接

Use the hyperlinks in column D to test the RUN::COMMAND  technique -- the hyperlink text explains what each link does.

使用D列中的超链接来测试RUN :: COMMAND技术-超链接文本说明每个链接的作用。

Excel HYPERLINK函数问题 (Excel HYPERLINK Function Issues)

Excel's HYPERLINK function lets you create links, but it has several shortcomings:

Excel的HYPERLINK函数可让您创建链接,但它有几个缺点:

  • It does not create an Excel Hyperlink object.

    它不会创建Excel超链接对象。
  • It does not populate the worksheet’s Hyperlinks collection.

    它不会填充工作表的“超链接”集合。
  • It does not trigger the worksheet’s FollowHyperlink event.

    它不会触发工作表的FollowHyperlink事件。
  • It returns a “shortcut” that looks like a text string but should not be treated as one.

    它返回一个看起来像文本字符串的“快捷方式”,但不应将其视为一个。
  • A cell using the HYPERLINK function has a default ScreenTip that cannot be changed.

    使用HYPERLINK功能的单元格具有无法更改的默认屏幕提示。
  • The Insert > Link (or Ctrl+K) dialog is not available for a cell containing the HYPERLINK function.

    插入>链接(或Ctrl + K)对话框不适用于包含HYPERLINK函数的单元格。
  • If a cell with a Hyperlink object defined using Ctrl+K is edited to add the HYPERLINK function, that HYPERLINK “shortcut” will be ignored in favor of the original Hyperlink object.

    如果编辑具有使用Ctrl + K定义的超链接对象的单元格以添加HYPERLINK函数,则该HYPERLINK“快捷方式”将被忽略,而使用原始的Hyperlink对象。

SuperLink用户定义功能 (SuperLink User Defined Function)

The SuperLink UDF, that J. Woolley created, resolves those HYPERLINK function  issues.

J. Woolley创建的SuperLink UDF解决了这些HYPERLINK函数问题。

On the Test sheet of the TestRunCommand.xlsm workbook, there is a section with examples for the SuperLink function, and an introduction in merged cells A19:D21.

在TestRunCommand.xlsm工作簿的“测试”表上,有一节包含有关SuperLink函数的示例,并在合并的单元格A19:D21中进行了介绍。

For a detailed explanation of the User Defined Function, read the SuperLink PDF file that is included in the download folder. You can open that file with Test Number 12 link, on the Tests sheet.

有关用户定义功能的详细说明,请阅读下载文件夹中包含的SuperLink PDF文件。 您可以在“测试”表上使用“测试编号12”链接打开该文件。

To test the SuperLink UDF, use the links that are set up on the Test sheet, in cells B23:D29. Those formulas show how the SuperLink UDF can be used to support application the updated RUN::COMMAND technique.

要测试SuperLink UDF,请使用“测试”表上B23:D29单元格中设置的链接。 这些公式显示了如何使用SuperLink UDF支持应用程序更新的RUN :: COMMAND技术。

问题或意见 (Questions or Comments)

If you have questions or comments about the Run Command Files technique, contact J. Woolley.

如果您对“运行命令文件”技术有疑问或意见,请联系J. Woolley

翻译自: https://contexturesblog.com/archives/2018/05/03/run-command-files-from-excel-update/

excel中运行dod命令

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值