+ Reply to Thread
Results 1 to 5 of 5

Error occurs, excel closes when running macro?

  1. #1
    Forum Contributor
    Join Date
    09-23-2007
    Location
    Melbourne, Australia
    Posts
    176

    Error occurs, excel closes when running macro?

    Hi
    I have a strange problem. I have build a pretty lengthy macro attached to a userform of which worked fine until I added another page into it. Now when the macro starts up it usually works fine for the first three goes (meaning I open the userform and close it again), but the fourth or fifth time the workbook crashes before the userform is shown. The error message says "an error has occured and excel needs to close"?

    I also tried to archive this workbook recently too and the problem seems to have been since then. Could this have changed something?. There is too much code to post.

    Another theory is that I built this using one computer with excel 2002 and took the macro to another computer and added another page to the userform with excel 2003. Would this be a problem. The excel version differences didn't make any difference before I added the new page or tried to archive the workbook. Has anyone any idea if there is a known problem which may be causing this?

    Thanks in advance.

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Without seeing the code I doubt if anyone can help.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Forum Contributor
    Join Date
    09-23-2007
    Location
    Melbourne, Australia
    Posts
    176

    Saving Workbook First

    I have found that the workbook doesn't crash when running the macro if the workbook is saved first. I've now incorporated that into my code. What could this tell me about the error? Saving it must remove he problem but I'm not sure why.

  4. #4
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    See my previous response!

  5. #5
    Forum Contributor
    Join Date
    09-23-2007
    Location
    Melbourne, Australia
    Posts
    176

    Code.

    Hi
    There are 56 A4 pages of code to post, it s a project and just can't be done. I'm moreso looking for a understanding of what saving a workbook does to it and why it prevents a macro from crashing. I don't know if it is the macro. I'm thinking it could also be becaue I built it on a computer with excel 2002 and then added another page onto the userform in excel 2003 on another computer. Possibly a compatability issue.

    Thanks.

+ 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