+ Reply to Thread
Results 1 to 15 of 15

Macro stopped working.

  1. #1
    Registered User
    Join Date
    06-04-2011
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    7

    Macro stopped working.

    Hi,

    I am using this macro to print selected sheets from a workbook with 229 sheets.
    It should only print the sheets with qualifying data in two specific cells. It worked perfectly for about 2 weeks. I went home on Tuesday and everything was fine, came back on Thursday and I am getting a runtime 13 miss match error.

    Any thoughts?

    Please Login or Register  to view this content.
    Thank you
    Last edited by joleen; 06-05-2011 at 06:27 AM. Reason: Solved

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

    Re: Macro stopped working.

    Why did you go home in the first place .... ?

    I'd try:

    Please Login or Register  to view this content.
    Last edited by snb; 06-04-2011 at 08:58 AM.



  3. #3
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: Macro stopped working.

    If you click Debug when the error message appears, which line of the code is highlighted?

  4. #4
    Registered User
    Join Date
    06-04-2011
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: Macro stopped working.

    The line that is highlighted is:

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    06-04-2011
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: Macro stopped working.

    I tried the new code. Thank you snb,

    But I am still receiving the same error.
    Last edited by joleen; 06-04-2011 at 08:53 AM. Reason: to clarify what post I was responding to

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

    Re: Macro stopped working.

    I don't think my suggestion will produce that error.

    Please Login or Register  to view this content.
    is the culprit.

  7. #7
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: Macro stopped working.

    @snb

    I don't think my suggestion will produce that error.
    apparently it does. Otherwise the asker would not report it. Instead of tagging the component

    Please Login or Register  to view this content.
    as "the culprit", do you have a suggestion about how to troubleshoot the issue?

  8. #8
    Registered User
    Join Date
    06-04-2011
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: Macro stopped working.

    I am using a the E1 cell on each sheet to reflect dates in cell A4 as just a number. When I had

    Please Login or Register  to view this content.
    I always ended up with sheets printed out where A4 was empty.

    I don't know if that helps at all.

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

    Re: Macro stopped working.

    Please Login or Register  to view this content.
    Last edited by snb; 06-04-2011 at 10:11 AM.

  10. #10
    Registered User
    Join Date
    06-04-2011
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: Macro stopped working.

    With

    Please Login or Register  to view this content.
    I receive a Runtime error '438' Object does not support this property or method.

    And still the line highlighted by the debugger is basically the same.

    Please Login or Register  to view this content.
    This file is moved back and forth from a sharepoint site everyday. Could that be causing corruption problems?

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

    Re: Macro stopped working.

    Has anything in the cells that are checked been changed? This might be on just one sheet
    Hope that helps.

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

    Free DataBaseForm example

  12. #12
    Registered User
    Join Date
    06-04-2011
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: Macro stopped working.

    I did a full manual check and yes actual a lot had changed.

    1) On almost all of the sheets cell A1 was "blank" instead of "empty" so instead of showing a zero in E1 it was blank
    2)I found a whole bunch of sheets were the formating had been changed from General to a custom date.
    3) There was one sheet where instead of E1 referencing A4 it had a REF# error.

    My guess is on my days off my co-worker cleared the data by deleting the whole row and not just contents of the cells.

    Everything is working now.
    Thank you so much for your help.

    Now if I can just figure out how to keep the empty cells empty I'll be in great shape.

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

    Re: Macro stopped working.

    Have you used sheet protection to lock cells?

  14. #14
    Registered User
    Join Date
    06-04-2011
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: Macro stopped working.

    I have locked most of the cells in the workbook. However I haven't locked anything that needs to have manual data entry. I was under the impression that there is no way to prevent a cell from being deleted and still have it open for data adjustment.

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

    Re: Macro stopped working.

    You might be able to protect the workbook structure using Workbook Protection.

    Naturally, make sure you have a back up file at all times

+ 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