'extra' file in VBE project- can't delete it? XL2003

K

KR

I started modifying an existing file...but I just noticed something that I
haven't seen before.

In the project window, under the MS Excel objects sub-folder, I normally see
each of my worksheets (with a little grid icon), and a "ThisWorkbook" with a
page icon with the Excel "XL" icon on it.

In this particular workbook, there is an /addition/ item with the page/XL
icon, and it is called "Sheet9". It doesn't appear to have any code; and the
listboxes at the top of the code page give me the "general" and "workbook"
options, just like the "ThisWorkbook" file.

I've tried everything I can think of to delete it, but can't find any way to
do so. I can export it successfully, just can't delete it.

Any thoughts on how to get rid of this file?
Thanks!
Keith
 
G

GS

Hi Keith,

There's two things that I can think of that you could try:

1. Check the sheet's visible setting in the properties. It might
actually exist but may have been hidden, (somehow). Format>Sheets>Unhide the
delete it.

2. Try Sheets("Sheet9").Delete in the Immediate window (while the
workbook is active).

HTH
Garry
 
K

KR

Garry- here are my results;

On #2, I get a run-time error #9, subscript out of range

On #1, the properties window does not show a visible property. In fact, when
I compare the available properties, and also the intellisense options when I
start typing "Sheet9." in the code window, I get the same list of properties
that are available for ThisWorkbook, not the ones I get for worksheets. This
is consistent with the weird icon thing I probably described poorly- it is
as if it thinks that Sheet9 is another ThisWorkbook object.

Interestingly, when I double-click on it in the Project window, I get an
empty code window...within that window, I can use the drop-down option for
workbook options (like workbook_open) and put in code (or put in a regular
sub, I get the same behavior on both); when I put the cursor within that
code block and click run, it brings up the mini-window of macros available
to run, rather than running the code block where the cursor is. Weird.

I'm now thinking this is some type of weird corruption of the file, although
I'm not looking forward to rebuilding this thing...
:-/

Thanks,
Keith
 

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