Results 1 to 3 of 3
  1. #1
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Shot down... via vba (2000 sr 1)

    is possible to shot down my pc via VBA? if yes how can.
    I have win 2000 prof...
    And i would want to use the nacro via vba for Excel...
    Tks.,

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Shot down... via vba (2000 sr 1)

    You'd need fairly complicated Windows API code to do that (shutting down Windows on Windows NT/2000/XP is more complicated than on Window 95/98/ME). Why do you need it?

  3. #3
    Silver Lounger
    Join Date
    Mar 2001
    Location
    Springfield, Ohio, USA
    Posts
    2,136
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Shot down... via vba (2000 sr 1)

    As Hans says, this is probably not something that you would want to do. To do it, you call InitiateSystemShutdown. The attached workbook demonstrates its use. The code is a slightly modified version of http://www.mentalis.org/apilist/24891B9AD1...6FB2ECA2AB.html, modified to run as a VBA macro. --Sam
    <font face="Comic Sans MS">Sam Barrett, CACI </font face=comic>
    <small>And the things that you have heard... commit these to faithful men who will be able to teach others also. 2 Timothy 2:2</small>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •