ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   OPen an DOS WIndow (https://www.excelbanter.com/excel-discussion-misc-queries/61389-open-dos-window.html)

nathandaviesuk

OPen an DOS WIndow
 

I would like to create a button in a form in a spreadsheet then use some
vba code that will open a the command prompt window then automatically
enter "ipconfig" in the command prompt window to display my IP
address.

Many thanks


--
nathandaviesuk
------------------------------------------------------------------------
nathandaviesuk's Profile: http://www.excelforum.com/member.php...o&userid=10790
View this thread: http://www.excelforum.com/showthread...hreadid=495155


Gary''s Student

OPen an DOS WIndow
 
Three steps:

1. Create a .bat file with
ipconfig /all
pause

2. Create a macro:
Sub Macro1()
x = Shell("cmd.exe /c C:\ip.bat", 1)
End Sub

3. Make a button and associate the macro with it.



--
Gary's Student


"nathandaviesuk" wrote:


I would like to create a button in a form in a spreadsheet then use some
vba code that will open a the command prompt window then automatically
enter "ipconfig" in the command prompt window to display my IP
address.

Many thanks


--
nathandaviesuk
------------------------------------------------------------------------
nathandaviesuk's Profile: http://www.excelforum.com/member.php...o&userid=10790
View this thread: http://www.excelforum.com/showthread...hreadid=495155




All times are GMT +1. The time now is 05:11 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com