Name disappears after Application.Run

D

Dean Meyer

A bug in Excel 2007 causes the name immediately following Print_Titles to
disappear from a workbook after Application.Run has called a routine in the
workbook, then the workbook is closed and reopened.

TO REPLICATE:
Create 2 workbooks: Master.xlsm and Slave.xlsm

In Slave.xlsm, do two things:
1) Name a range QQQ (such that it follows Print_Titles)
2) Create a VB macro called NoOp that does nothing.

In Master.xlsm:
1) Create a VB macro that does:
Application.Run "'Slave.xlsm'!NoOp"

Now, close Slave (with or without saving it), keeping Master open. Reopen
Slave, and the first name following Print_Titles cannot load. It's in the
file, but not in the name manager when the file is loaded.

WORKAROUND: Always ensure there is a name Print_Titles_ZZZZZZ, replace if
missing on WorkbookOpen.

QUESTION: Is there any other damage caused by this bug that I haven't
discovered yet?
 
T

TonyR

Dean,

Thank you for solving a problem which has been driving me crazy for the last
few months.

I think it's not just Application.Run, but any use of the application
object, e.g. Application.Statusbar that makes the next range name after
Print_Area disappear.

Regards,
Tony
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top