From: Eric on 30 Apr 2010 20:25 I would like to close existing file and go hibernate, but once this file is closed, the command hibernate cannot be run. On the other way, I run the hibernate, which work, but the file cannot be closed. Does anyone have any suggestions on how to close file and hibernate XP? My PC is XP with SP3 and using office 2003 Thanks in advance for any suggestions Eric Workbooks("Update Up.xls").Close savechanges:=True hibernate Public Sub hibernate() 'ShutDownHibernate 'Go into hibernate, force it, but don't disable wake events SetSuspendState 1, 1, 0 End Sub
From: Peter T on 1 May 2010 06:49 The Hibernate API looks what I suggested to you in a previous post. I assume the code to call the hibernate is in the same file that you are wanting to close. It's a bit confusing though, if that were the case not sure why you are not doing simply Thisworkbook.close True If(?) my assumption is right, put the hibernate code in your Personal together with another routing ' in personal sub OnTimeHibernate() application.ontime now, "Hibernate" end sub sub Hibernate SetSuspendState 1, 1, 0 end sub just before doing closing Thisworkbook do Application.Run "Personal.xls!OnTimeHibernate" ' or .xlsm If my assumption is wrong explain what you are doing to avoid guessing. Regards, Peter T "Eric" <Eric(a)discussions.microsoft.com> wrote in message news:1F80C027-F062-422B-A1EE-8F65127A16AD(a)microsoft.com... >I would like to close existing file and go hibernate, but once this file is > closed, the command hibernate cannot be run. On the other way, I run the > hibernate, which work, but the file cannot be closed. > Does anyone have any suggestions on how to close file and hibernate XP? > My PC is XP with SP3 and using office 2003 > Thanks in advance for any suggestions > Eric > > Workbooks("Update Up.xls").Close savechanges:=True > hibernate > > Public Sub hibernate() > 'ShutDownHibernate > 'Go into hibernate, force it, but don't disable wake events > SetSuspendState 1, 1, 0 > End Sub > >
|
Pages: 1 Prev: Splitting a string into columns Next: How to look up each Excel workbook raw in another. |