ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Shut Down PC (https://www.excelbanter.com/excel-programming/352194-shut-down-pc.html)

helmekki[_128_]

Shut Down PC
 

Hi there

Is there a vba code to shut Down PC ? :(

Thank u


--
helmekki


------------------------------------------------------------------------
helmekki's Profile: http://www.excelforum.com/member.php...fo&userid=6939
View this thread: http://www.excelforum.com/showthread...hreadid=507743


Leith Ross[_523_]

Shut Down PC
 

Hello Hesham,

Here is an API routine that calls the shutdown dialog.

Public Declare Function SHShutDownDialog _
Lib "shell32.dll" _
Alias "#60" _
(ByVal Display As Long) As Long


To invoke the Shutdown Dialog:

RetVal = SHShutDownDialog(0&)

Sincerely,
Leith Ross


--
Leith Ross
------------------------------------------------------------------------
Leith Ross's Profile: http://www.excelforum.com/member.php...o&userid=18465
View this thread: http://www.excelforum.com/showthread...hreadid=507743


helmekki[_129_]

Shut Down PC
 

Thank u v much :)

How can make the shutDown triggered by the code it self without the
user interferance...........?


--
helmekki


------------------------------------------------------------------------
helmekki's Profile: http://www.excelforum.com/member.php...fo&userid=6939
View this thread: http://www.excelforum.com/showthread...hreadid=507743


gti_jobert[_9_]

Shut Down PC
 

Private Sub UserForm_Initialize()
call Shtdown
end sub


????


--
gti_jobert
------------------------------------------------------------------------
gti_jobert's Profile: http://www.excelforum.com/member.php...o&userid=30634
View this thread: http://www.excelforum.com/showthread...hreadid=507743



All times are GMT +1. The time now is 01:56 AM.

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