Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default Referencing one workbook in other???

Hi,

I have one workbook (book1) which is referenced in another one (book2).
book1 is database workbook, book2 is reporting book and each workbook has
some vba codes. i wrote some codes to open book1 when book2 is opened. also
some codes for closing routines exist.

The problem is when i try to close book2, book1 has to closed otomatically.
but excel gives me some error messages that says -book1 is referenced in
other workbooks, closing not possible-. and leaves book1 opened.

does anybody have an idea, how can i walk around that problem.



Thanks.


Haldun


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default Referencing one workbook in other???

Post the code that's used to close book2 and give the exact error msg.

HWH


"Haldun Alay" wrote in message
...
Hi,

I have one workbook (book1) which is referenced in another one (book2).
book1 is database workbook, book2 is reporting book and each workbook has
some vba codes. i wrote some codes to open book1 when book2 is opened.

also
some codes for closing routines exist.

The problem is when i try to close book2, book1 has to closed

otomatically.
but excel gives me some error messages that says -book1 is referenced in
other workbooks, closing not possible-. and leaves book1 opened.

does anybody have an idea, how can i walk around that problem.



Thanks.


Haldun




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default Referencing one workbook in other???

Post the code that's used to close book2 and give the exact error msg.

HWH


"Haldun Alay" wrote in message
...
Hi,

I have one workbook (book1) which is referenced in another one (book2).
book1 is database workbook, book2 is reporting book and each workbook has
some vba codes. i wrote some codes to open book1 when book2 is opened.

also
some codes for closing routines exist.

The problem is when i try to close book2, book1 has to closed

otomatically.
but excel gives me some error messages that says -book1 is referenced in
other workbooks, closing not possible-. and leaves book1 opened.

does anybody have an idea, how can i walk around that problem.



Thanks.


Haldun





  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Referencing one workbook in other???

If you open book2, then book1 will be opened automatically - you don't need
code to open it.

You must close book2 before you can close book1. If your code to close
book1 is in Book2, then you will not be able to do that since book2 will
remain open while it is running the code.

What you might want to do is have code in Book1 that will close book1.
Then, in the Book2 beforeClose event, use application.Ontime command to
execute the code in Book1. You can see examples of using application ontime
at Chip Pearson's site

http://www.cpearson.com/excel/ontime.htm

Although his example demonstrates repetitive calls to ontime - you only need
to call it once.

--
Regards,
Tom Ogilvy


"Haldun Alay" wrote in message
...
Hi,

I have one workbook (book1) which is referenced in another one (book2).
book1 is database workbook, book2 is reporting book and each workbook has
some vba codes. i wrote some codes to open book1 when book2 is opened.

also
some codes for closing routines exist.

The problem is when i try to close book2, book1 has to closed

otomatically.
but excel gives me some error messages that says -book1 is referenced in
other workbooks, closing not possible-. and leaves book1 opened.

does anybody have an idea, how can i walk around that problem.



Thanks.


Haldun




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
Functions referencing a different workbook Haydie-lady[_2_] Excel Worksheet Functions 1 April 7th 09 05:14 PM
cross referencing to another workbook green72 Excel Discussion (Misc queries) 3 January 29th 08 04:02 PM
Referencing other workbook. [email protected] Excel Worksheet Functions 1 September 4th 06 05:59 PM
Referencing a different Workbook Ken Excel Worksheet Functions 8 November 24th 05 01:20 AM
Referencing another Workbook Bill Martin -- (Remove NOSPAM from address) Excel Discussion (Misc queries) 0 April 6th 05 07:16 PM


All times are GMT +1. The time now is 09:14 AM.

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"