Excel VBA Course
Excel VBA Course - From Beginner to Expert

200+ Video Lessons
50+ Hours of Video
200+ Excel Guides

Become a master of VBA and Macros in Excel and learn how to automate all of your tasks in Excel with this online course. (No VBA experience required.)

View Course

Very clever and Interesting.

0

Would like to be able to acces CMD prompt from an Excel cell using Hyperlink 

But when I put in C:/Windows/System32 in the cell then do Ctl K , I do NOT get CMD prompt as indicated below.

Microsoft Windows [Version 10.0.17134.407]
(c) 2018 Microsoft Corporation. All rights reserved.

C:\Windows\System32>

I am running Microsoft Office Home and Business 2019.

Any suggestions

stubbsy9

Answer
Discuss

Answers

0

I don't think you can use a hyperlink to open the command prompt because the hyperlink will try to open the file it points at, as opposed to run it as a program. The function below will open the command prompt. You can run it from a button on your worksheet or attach it to a cell by linking the cell to a click event.

Function DosCmd()
    DosCmd = Shell("C:\Windows\System32\cmd.exe", 1)
End Function
Discuss


Answer the Question

You must create an account to use the forum. Create an Account or Login