+ Reply to Thread
Results 1 to 4 of 4

macro does not complete

  1. #1
    Registered User
    Join Date
    12-31-2008
    Location
    Chester, CA
    MS-Off Ver
    Excel 2007
    Posts
    20

    macro does not complete

    Hi - I have a macro that will not complete, and I can not figure out why. The macro is CHECK_for_Sheets_THEN_Copy_DATA:
    Please Login or Register  to view this content.
    I have a function, to define "worksheetexist":
    Please Login or Register  to view this content.
    It all seems to hang up around the SaveAs macro, which is ran from near the begining. The SaveAs code seems to runs fine by itself. That code is:
    Please Login or Register  to view this content.
    Because of message boxes I've placed in the code, the SaveAs macro seems to run twice when it is initiated from the CHECK_for_Sheets_THEN_Copy_DATA macro and does not complete (stops before it actually saves).

    I would appreciate any help - Jim A

    I've attached my workbook if anybody is interested.
    Attached Files Attached Files
    Last edited by jayers; 01-26-2009 at 08:30 PM.

  2. #2
    Registered User
    Join Date
    01-26-2009
    Location
    Italy
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: macro does not complete

    Be carefull!

    Please Login or Register  to view this content.
    search the sheet with the name = "1". You have to use
    Please Login or Register  to view this content.
    It's so different

    Those lines raise the errors, not the save command. To see where the errors appen, instead
    Please Login or Register  to view this content.
    Use
    Please Login or Register  to view this content.
    In this way you know better witch is the error. Or, better, don't use error trapping until you know that there aren't errors. VBA breaks on the line where errors appened.


    NB: I think there is an error in the path where you want save

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

    Re: macro does not complete

    Don't use On Error until the code is completed & working
    Hope that helps.

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

    Free DataBaseForm example

  4. #4
    Registered User
    Join Date
    12-31-2008
    Location
    Chester, CA
    MS-Off Ver
    Excel 2007
    Posts
    20

    Re: macro does not complete

    Quote Originally Posted by Lucio View Post
    Be carefull!

    Please Login or Register  to view this content.
    search the sheet with the name = "1". You have to use
    Please Login or Register  to view this content.
    It's so different

    Those lines raise the errors, not the save command. To see where the errors appen, instead
    Please Login or Register  to view this content.
    Use
    Please Login or Register  to view this content.
    In this way you know better witch is the error. Or, better, don't use error trapping until you know that there aren't errors. VBA breaks on the line where errors appened.


    NB: I think there is an error in the path where you want save
    I have used this to better help me diagnose my problems. 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