Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

Running two workbooks with click events 1

Status
Not open for further replies.

Conex

Structural
Feb 8, 2002
10
0
0
NL
Has anyone tried running two Excel Workbooks together, with a macro in one replacing cell values and changing option/check boxes in the second workbook?

As soon as the first workbook effects a option/check box change in the second workbook the relevent option/check box macro click event occurs causing Excel to crash.

Any ideas how I can overcome this? Perhaps there is a way of preventing/delaying the option/check box macro click event occuring until after the first workbook macro has finished replacing the cell values and tickboxes.
 
Replies continue below

Recommended for you

Conex:

I have not tried this before, but I just briefly worked on your problem.

I set up option boxes in worksheet 1. They are linked to cells in worksheet 2. Based on the status of linked cells in worksheet 2, I generate a list in worksheet 2 that feeds a listbox in workseeht 2. I also set up another set of option boxes in worksheet 2 linked to the same cells (in worksheet 2) that the option boxes from worksheet 1 were linked to.

Everyhting seems to work fine. All linked cells update appropriately, the list box changes, both sets of option boxes change to reflect the other regardless of which one initiates the change.

So maybe I'm not following your problem. Could there be a problem in some of your other code? I have not added any VB code in my trial - I've just set up VB controls with links and used IF statements to generate a list.

best luck,

ProjEngKLS
 
Conex:

I was saying "worksheet" in my previous post, but I actual did this in two different workbooks. So please replace "Worksheet" with "workbook".


ProjEngKLS
 
Thanks for that ProjEngKLS,

I tried a new pair of workbooks like you and found no problems either!

I have a lot of code running and have found while a macro in one workbook is making changes to the 2nd workbook, which in turn sets off more macros in the 2nd workbook, was causing the crash. I thought I had turned off screen updating and autocalc but a colleauge pointed out an error in my code which meant it had not been turned off. That corrected it no longer crashes.

Many thanks for the time you spent with it. I have had problems with my PC and Excel (3 minutes to load a simple workbook is instant on older & slower machines) so was not sure what was going on.

happy.gif
 
Status
Not open for further replies.
Back
Top