Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,670
Default How to close file and hibernate?

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


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default How to close file and hibernate?

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" wrote in message
...
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




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to close file and hibernate? Eric Excel Discussion (Misc queries) 2 May 4th 10 07:44 PM
How to hibernate Windows XP at the end of macro? Eric Excel Programming 4 April 23rd 10 03:21 PM
Hibernate Button Amos Carver Excel Discussion (Misc queries) 1 June 2nd 09 05:44 PM
Hibernate via VBA mcphc Excel Programming 5 May 18th 07 01:06 PM
Hibernate using Excel macro Rod Armour Excel Programming 0 December 10th 03 07:29 AM


All times are GMT +1. The time now is 11:15 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"