+ Reply to Thread
Results 1 to 8 of 8

Excel 2002 Delete Thisworkbook code Not Working.

  1. #1
    Valued Forum Contributor realniceguy5000's Avatar
    Join Date
    03-20-2008
    Location
    Fl
    MS-Off Ver
    Excel 2003 & 2010
    Posts
    951

    Excel 2002 Delete Thisworkbook code Not Working.

    Good Morning,

    I have a small problem where I am using this code below in excel 2003 and it works fine. However when I try to run on a machine with excel 2002 it crashes.

    When I looked in the References in VBA,It looks like that maybe something in the 11.0 object library may differ from the 10.0 Object Library, but I'm not sure ???

    Is there a work around for the 2002 Machine?


    Please Login or Register  to view this content.
    Thank You, Mike

  2. #2
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: Excel 2002 Delete Thisworkbook code Not Working.

    You could try (I'd prefer):

    Please Login or Register  to view this content.



  3. #3
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Excel 2002 Delete Thisworkbook code Not Working.

    Do you have trusted access to the vbProject set on the 2002 machine?
    Remember what the dormouse said
    Feed your head

  4. #4
    Valued Forum Contributor realniceguy5000's Avatar
    Join Date
    03-20-2008
    Location
    Fl
    MS-Off Ver
    Excel 2003 & 2010
    Posts
    951

    Re: Excel 2002 Delete Thisworkbook code Not Working.

    Thanks SNB... for the try...But the program still crashes at that point in the code. Note this code still works in excel 2003, It only crashes in excel 2002.

    Any Other Ideas?

    Yes, I have the trust checked on the 2002 Machine.

    Thank You, Mike
    Last edited by realniceguy5000; 09-20-2011 at 08:05 AM. Reason: Additional Info

  5. #5
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Excel 2002 Delete Thisworkbook code Not Working.

    Is the code running in the same workbook or a different one?

  6. #6
    Valued Forum Contributor realniceguy5000's Avatar
    Join Date
    03-20-2008
    Location
    Fl
    MS-Off Ver
    Excel 2003 & 2010
    Posts
    951

    Re: Excel 2002 Delete Thisworkbook code Not Working.

    It is the same workbook.

    The workbook was created on a 2003 Machine, I moved the entire workbook to another 2003 Machine and it works fine. I'm only having issues on the 2002 Machine.

    I just ran a test I created a new workbook on the 2002 Machine placed the code in a mod and it ran fine, Whats going on with the other workbook?



    Thanks for looking. Mike

  7. #7
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Excel 2002 Delete Thisworkbook code Not Working.

    Hard to say. Personally I have always avoided code that alters code if at all possible because when it doesn't work, it's a nightmare to correct. It may be that it has improved in later versions but my experiences with 2000-2003 put me off somewhat. I would certainly not try and alter the same project that the code was in.

  8. #8
    Valued Forum Contributor realniceguy5000's Avatar
    Join Date
    03-20-2008
    Location
    Fl
    MS-Off Ver
    Excel 2003 & 2010
    Posts
    951

    Re: Excel 2002 Delete Thisworkbook code Not Working.

    Thank You, maybe I can create this workbook on the 2002 Machine and see how that works.

    or

    I really need either to delete this code or not run the workbook open code. Maybe I can run a check on the workbook open against the file name. So if the file name = the orginal workbook name it runs and if not it wont.

    Let me try that.

    Thanks as always for the help.

    Mike.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1