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