More than 1 workbook in a VBAProject

R

R Avery

I have a workbook that I inherited, but it has the strange property of
having a "ThisWorkbook" object and a "ThisWorkbook1" object. There are
also several sheet objects that do not correspond to any worksheet,
visible or otherwise, and when I look at the properties window when
selecting those sheets on the Project Explorer, these phantom sheets
have the properties of "ThisWorkbook1".


It is very strange. I asked a microsoft expert here at work and he said
that its just not possible. The file was somehow corrupted. However,
it continues to work properly, and I have been using it for almost a year.

I am just curious what this is, what exactly it means, and how it might
have happened. Does anyone know? If anyone wants to see it, I can
strip it of all company-specific data, and send them the workbook with
the two ThisWorkbook objects.
 
P

pikus

I would like to see that. Please post it or e-mail it to me:
(e-mail address removed)
Thanks
 
D

DNF Karran

Pikus,

Could you add it this thread as i'm curious too!!

All i can think of is a class module has been used or an objec
variable is defined somewhere....

Dunca
 
T

Tushar Mehta

Please, no.

Do *not* post workbooks as attachments to newsgroup posts.

--
Regards,

Tushar Mehta
www.tushar-mehta.com
Excel, PowerPoint, and VBA add-ins, tutorials
Custom MS Office productivity solutions
 
T

Tom Ogilvy

Pikus >, your in the Excel Forum; Tushar is in a newsgroup. For the forum,
there are provisions for attaching binaries - so you can post them there if
you desire. For the newsgroup, it is discouraged because of the storage
overhead and so forth since this is a non-binaries newsgroup. R Avery is
posting in the newsgroup.
 
R

R Avery

No, the "ThisWorkbook" and "ThisWorkbook1" both have the same worksheet
icon with the little green "XL".

In a new workbook, I tried exporting and re-importing "ThisWorkbook".
It was imported as a class module with the standard class module icon.
This is not what has happened to the workbook I am talking about.
 
R

R Avery

I will not post the workbook to the newsgroup, but rather email it to
anyone who gives me their email address.
 
R

R Avery

Also, you know how you can refer to a worksheet by its code name? Well,
I tried to do that for the phantom sheets, "?Sheet1.Name" in the
immediate window, and I get the following error:

Run-time error '429':
ActiveX component can't create object
 

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