How to close file and hibernate?

  • Thread starter Thread starter Eric
  • Start date Start date
E

Eric

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
 
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
 
Back
Top