Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default BeforeClose Dilemma

hello everbody,
I have three workbooks;
WorkbookA, WorkbookB & WorkbookC (pseudonyms of course)
WorkbookA is the main project workbook.
WorkbookB serves as the Index workbook
that allows you to open one workbook
from a selection of a few hundred workbooks.
That one workbook becomes WorkbookC.
When WorkbookC opens, WorkbookB closes
leaving workbooks A & C open.
The user selects data to copy from
WorkbookC to WorkbookA by checking checkboxes
then a button attached to the procedure
that does the copy & paste routine.

When the user is done with "WorkbookC"
he must use the workbook's builtin "X" close button
to close the workbook.
I have a (Workbook_BeforeClose) procedure
in the ThisWorkbook code module.

1. It checks to see if any checkboxes are currently checked.
if not then it's ok to close out.
2. If it finds that there are checkboxes checked
it opens a userform located in an addin that alerts the user
he made a selection that would close the workbook
while some items remained checked
and it gives the user two choices:
1. copy the checked items to WorkbookA before closing, or
2. close the workbook without copying items.

if he chooses option 1
then it copies the data from bookA and pastes it in bookB.
if he chooses option 2
then bookC should just close without sending data to bookA.

Where the problem arises is;
I need both procedures to finish up by
closing WorkbookC when done and automatically
re-open WorkbookB.

I think it's the "Cancel=True" that's giving me headaches.

(Without it)
the bookC closes prematurely without finishing code.

(With it)
the bookC won't close at all

I'm hoping one of you gurus have an idea of what
my problem might be without me posting the code
because there's a bunch of it.

Of course if this can't be resolved without
viewing the code, we can go there. :)

Any suggestions would be so appreciated.
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
beforeclose placement Curt Excel Discussion (Misc queries) 9 August 27th 07 08:00 PM
PASSWORD PROTECT BEFORECLOSE KandK Excel Discussion (Misc queries) 4 June 8th 06 09:34 AM
Cancelling the BeforeClose Event Troy[_5_] Excel Programming 6 December 2nd 03 06:40 AM
BeforeClose event - Savings Mike[_40_] Excel Programming 3 September 24th 03 11:33 AM
Excel - BeforeClose Problem... Al Mackay Excel Programming 0 September 22nd 03 12:26 PM


All times are GMT +1. The time now is 10:06 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"