You can use Excel to a , go to web pages, open other Excel files, and even open PDF files. , if you try to use an Excel to run files, you’ll run into . Until now! Here’s how J. uses , with a macro, to avoid those – and a other too. He also found a bug.
您可以使用Excel超鏈接瀏覽工作簿,轉(zhuǎn)到網(wǎng)頁,打開其他Excel文件,甚至打開PDF文件。 但是,如果您嘗試使用Excel超鏈接來運(yùn)行命令文件,則會遇到問題。 到現(xiàn)在! 這就是J.如何使用帶有背景宏的超鏈接來避免這些問題以及其他問題。 他還發(fā)現(xiàn)了一個(gè)奇怪的超鏈接錯(cuò)誤。
超鏈接命令文件問題 ( File )
and Excel files open (), if you click a in a . With files, you’ll run into , such as:
如果您單擊工作表中的超鏈接,則網(wǎng)站和Excel文件將正常打開(通常)。 使用命令文件,您會遇到一些問題excel超鏈接到同文件夾文件,例如:
地址錯(cuò)誤問題 (Bad )
Even with file types that open from a , you’ll see an error if there is a with the . Here’s what if I in a cell, and then click the link that is .
即使應(yīng)該從超鏈接打開的文件類型,如果地址有問題,您也會看到錯(cuò)誤消息。 如果我在單元格中拼寫了,然后單擊自動創(chuàng)建的鏈接,則會出現(xiàn)以下內(nèi)容。
The says, “ to open the or proxy .’
消息顯示,“無法打開。無法找到服務(wù)器或代理服務(wù)器。”
超鏈接到打開的命令文件 ( to Open Files)
To these , J. a that runs files, by a macro when types of are .
為了克服這些問題,J。通過單擊特定類型的超鏈接時(shí)啟動宏來創(chuàng)建一種運(yùn)行命令文件的技術(shù)。
To set up one of these :
要設(shè)置這些特殊超鏈接之一:
示例腳本超鏈接 ( for )
For , this is set up to run a file, in the same as the Excel file.
例如,此超鏈接設(shè)置為運(yùn)行腳本文件excel超鏈接到同文件夾文件,該腳本文件與Excel文件存儲在同一文件夾中。
When you click the link, the Excel macro runs the runs, and opens a where you enter text
當(dāng)您單擊鏈接時(shí),Excel宏將運(yùn)行腳本,并打開一個(gè)窗口,您可以在其中輸入文本
Next, it shows a with the text that you .
接下來,它顯示一條消息,其中包含您輸入的文本。
超鏈接錯(cuò)誤 ( Bug)
While on this , J. found an odd bug. Or maybe it’s a . Here’s how you can it:
在研究這項(xiàng)技術(shù)時(shí),J。發(fā)現(xiàn)了一個(gè)奇怪的超鏈接錯(cuò)誤。 也許這是一個(gè)功能。 重新創(chuàng)建的方法如下:
looks okay, but the next step shows the
一切看起來還不錯(cuò),但是下一步顯示了問題
You can’t click on them — the is from all of the other cells where the was !
您無法單擊它們-超級鏈接將從粘貼超級鏈接的所有其他單元格中刪除!
of a hand, the mouse is a white plus sign.
鼠標(biāo)指針不是白色的指針,而是白色的加號。
避免超鏈接錯(cuò)誤 ( the Bug)
All the cells were as a .Range., of one per cell. You can see that if you run the code on that .
所有粘貼的單元都被視為單個(gè).Range.,而不是每個(gè)單元具有一個(gè)地址。 您可以看到,如果在該工作表上運(yùn)行以下代碼。
I was able to avoid the by also a blank cell the cell, and that too.
我還可以通過在原始超鏈接單元格旁邊復(fù)制一個(gè)空白單元格并將其粘貼來避免該問題。
J. has a few other for the , and those are in the PDF file that’s in the file.
J. 還有其他一些避免該問題的建議,這些建議都在下載文件中的PDF文件中。
獲取超鏈接示例文件 (Get the Files)
the file from my , to get all the on how this works. On the Files page, go to the and VBA . Look for
從我的網(wǎng)站下載示例文件,以獲取有關(guān)此技術(shù)如何工作的所有詳細(xì)信息。 在“ 示例文件”頁面上 ,轉(zhuǎn)到“用戶窗體和VBA”部分。 尋找
the file (see notes below), then unzip the file, and keep all the files in the same , for .
解壓縮該壓縮文件(請參閱下面的注釋),然后解壓縮該文件,并將所有文件保留在同一文件夾中以進(jìn)行測試。
The :
壓縮文件夾包含:
取消阻止文件 ( the Files)
you unzip the , be sure to the file in .
解壓縮下載的文件夾之前 ,請確保在資源管理器中解壓縮壓縮文件。
Right-click the file, then click
右鍵單擊壓縮文件,然后單擊“屬性”。
Add a check mark in the box, near the of the .
在“屬性”窗口底部附近的“ 取消阻止”框中添加一個(gè)復(fù)選標(biāo)記。
Click OK, to close the
單擊確定,關(guān)閉“屬性”窗口The, unzip the , and all the files will be , and ready to use.
將文件夾解壓縮,其中的所有文件將被解除阻止并可以使用。 評論或問題 ( or )
If you have or about the Run Files , J. .
如果您對“運(yùn)行命令文件”技術(shù)有疑問或意見,請聯(lián)系J. 。
翻譯自:
excel超鏈接打開文件夾