Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Functions referencing a different workbook | Excel Worksheet Functions | |||
cross referencing to another workbook | Excel Discussion (Misc queries) | |||
Referencing other workbook. | Excel Worksheet Functions | |||
Referencing a different Workbook | Excel Worksheet Functions | |||
Referencing another Workbook | Excel Discussion (Misc queries) |