Two 'ThisWorkbook' objects in one VBAProject...PLEASE HELP
Two 'ThisWorkbook' objects in one VBAProject...PLEASE HELP
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 4 of 4

Thread: Two 'ThisWorkbook' objects in one VBAProject...PLEASE HELP

  1. #1
    New Member
    Join Date
    Feb 2002
    Location
    Presque Isle, Maine, USA
    Posts
    12
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

     
    I imported a file *.cls which was a 'ThisWorkbook' object in another project in order to copy the code (don't ask why). In doing so I forgot to then remove the imported one. Now, there are two 'ThisWorkbook' objects, and XL 97 crashes whenever I open the workbook. For whatever reason, it doesn't crash in XL 2002, which is what I'm (trying) to develop this app in.

    Does anyone know a way to get into the guts of this project and remove the second 'ThisWorkbook' object??

    Thank you SO much for any help,
    Gahagan

  2. #2
    Board Regular
    Join Date
    Mar 2002
    Location
    Sydney/Brisbane , Australia
    Posts
    538
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    first thing. if you cant open a up the owrkbook then open a blankworkbook and isable the macros.

    then go into your VBA and objects property and delete the macro from in there.

    if the macro is on a button then make sure the buttons address doesnt read
    -workbook!macro1
    it should just have the macro name.

    (hope this helps a bit)

  3. #3
    New Member
    Join Date
    Feb 2002
    Location
    Presque Isle, Maine, USA
    Posts
    12
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    I tried that too, but thanks!

    Usually I would right-click the object and click 'remove x...' but that option is disabled for the 2nd 'ThisWorkbook' object.

    2002 doesn't allow programmatic removal of VBComponents through the VBA Extensible reference; 97 does but only if the Workbook would open long enough to do it...!

    AAAHHHH!

    I guess I'll start over. Thanks anyway!
    Gahagan

  4. #4
    Board Regular
    Join Date
    Mar 2002
    Location
    Sydney/Brisbane , Australia
    Posts
    538
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

      
    I am a 97 user,
    and find that some of my macros intermoittently reopen the current file. and then my excel crashes too.

    the only solution i found was to make sure i chenged the macro link so as not to include the file name and then save the change.

    sorry. I have no ideas.. 97 deffinitely has bugs.
    All the best.

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

 

 
DMCA.com