Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 114
Default Problems with Activeworkbook.Close

On Feb 2, 9:18*pm, Terry wrote:
On Feb 2, 8:41*pm, Tim Williams wrote:

Why use workbook_activate rather than workbook_open ?


Not sure that would fix your problem but worth a try...


Tim


Actually, it is on open and not activate.

Wherever it is, it only exhibits this bizarre behavior if there is at
least one other workbook open.


Hard to suggest anything without seeing actual code.

Tim
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Problems with Activeworkbook.Close

On Feb 3, 9:02*am, Tim Williams wrote:
On Feb 2, 9:18*pm, Terry wrote:

On Feb 2, 8:41*pm, Tim Williams wrote:


Why use workbook_activate rather than workbook_open ?


Not sure that would fix your problem but worth a try...


Tim


Actually, it is on open and not activate.


Wherever it is, it only exhibits this bizarre behavior if there is at
least one other workbook open.


Hard to suggest anything without seeing actual code.

Tim


I fixed it, it took a rather convoluted approach. What was happening
was after the Activeworkbook.Close the workbook_deactivate event would
invoke some of the common code which would effect changes in the
workbook being closed. This seemed to confuse Excel if there were any
other workbooks open.

What I did was determine at workbook_open time that I wanted to close
this workbook and set a global close flag.

At the end of the workbook_activate event I invoked the
Activeworkbook.Close method if my close flag was set.

Then at the end of the workbook_deactivate event I set
Activeworkbook.Saved=True if my close flag was set.

Now it works perfectly.
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
ActiveWorkbook.close problem Spike Excel Programming 6 May 25th 09 02:58 PM
In Before Close Sub ActiveWorkBook.Close(False) repeat procedure [email protected] Excel Programming 5 September 26th 06 03:11 PM
ActiveWorkbook.Close dallas Excel Programming 0 November 3rd 04 06:27 PM
ActiveWorkbook.Close dallas Excel Programming 2 November 3rd 04 05:56 PM
ActiveWorkbook.Close Matthew[_9_] Excel Programming 4 November 13th 03 02:48 AM


All times are GMT +1. The time now is 03:10 PM.

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

About Us

"It's about Microsoft Excel"