vba - Error when quitting Excel and Logging Off -
I need some help with Excel VBA (on Windows 7 2010). What am I trying to do, close the Excel and then shutting down the PC? Code is I:
declared function ExitWindowsEx & amp; Global Const EWX_LOGOFF = 0 Global Constitutes EWX_FORCE = 4 .... Main Code Here .... Application.DisplayAlerts = False Application.Quit = ExitWindows (as opposed to liveValvReserved, byVal dwReserved as Lib by "Vivor32 "(ByVal uFlags Long) I can not leave the following error: Microsoft Excel Even though it still logs out, which I want, this is not a big issue. I would like to go out properly I have placed EWX_FORCE because I do not want to be prompted by Windows any suggestions?
After
missing doEvents after Application.Quit It is possible? Include this so that you get the error, enough time is required to close Excel. BTW This works for me. In addition to this, if a workbook / workbook has been opened, it is a good idea to touch the data / without saving / stopping it. Public declaration function ExitWindowsEx Lib "user32" (long-term, dwVptions, as long as preserved in the long run) long public building as long as EWX_LogOff = 0 Public Works EWX_SHUTDOWN As Long = 1 Public Works EWX_REBOOT As Long = 2 Public Constant EWX_FORCE Long = 4 Sub Sample () In '' ~~ & gt; The main code here is' application. Display Eltar = Incorrect application.CutDevents ExtrivxXEWX_LogOff or EWX_FORCE, and HFFFF and all
Comments
Post a Comment