+ Reply to Thread
Results 1 to 8 of 8

cannot find what is causing the bug

  1. #1
    Forum Contributor unley's Avatar
    Join Date
    11-27-2008
    Location
    South Australia
    MS-Off Ver
    MS Office 2007
    Posts
    253

    cannot find what is causing the bug

    Hi to all, I had to change sheet one but everytime I open this workbook, it keep saying "Application-defined or object-defined error"

    but I cannot find what is causing the bug. I have checked the name of sheet and it seem correct for me in the codes.
    Can someone please find out what is causing the bug? It is only a small code and error comes from workbook. Thank you in advance

    I have enclosed the attachment for you to see

    Utility_Access.xls



    By the way, I'm using Excel 2003
    Last edited by unley; 01-13-2009 at 04:36 PM.

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258
    Hello unley,

    I moved the macro [d]duedate[/b] into a standard VBA module. This can be run when the workbook opens. The changes have already been made to the attached workbook.

    Module Code
    Please Login or Register  to view this content.
    Workbook Open Event Macro
    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross
    Attached Files Attached Files

  3. #3
    Forum Contributor
    Join Date
    01-10-2006
    Location
    Ahmedabad, India
    MS-Off Ver
    Office 2000
    Posts
    346
    Change your This Workbook sub to

    Please Login or Register  to view this content.
    A V Veerkar

  4. #4
    Forum Contributor unley's Avatar
    Join Date
    11-27-2008
    Location
    South Australia
    MS-Off Ver
    MS Office 2007
    Posts
    253
    Thank you Leith Ross and avveerkar for quick reply.

    avveerkar, there's no debug but the dates that are more than 11 months old did not highlighted in red (color 3)
    After I deliberately add an older date like a year ago in E column, it supposed to highlight the this date in red when open the workbook next time but it did'nt. There must be a simple fix there somewhere.

    Leith, there's a debug in Module that you've created and highlighted in yellow
    Please Login or Register  to view this content.
    It works fine when I deleted some spaces between codes

    So thankyou both very much for your help. Cheers for now

  5. #5
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258
    Hello unley,

    When using the SpecialCells method, you need to incorporate error handling in your code. More often than not, failure to find the cell type results in a error. I didn't think to add the error handler because the workbook you attached was blank.

    Sincerely,
    Leith Ross

  6. #6
    Forum Contributor unley's Avatar
    Join Date
    11-27-2008
    Location
    South Australia
    MS-Off Ver
    MS Office 2007
    Posts
    253
    Thank you for advice Leith but the workbook I attached is no blank otherwise how did you copy my codes?

  7. #7
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258
    Hello unley,

    I meant there is no data on the worksheet for the macro to use.

    Sincerely,
    Leith Ross

  8. #8
    Forum Contributor unley's Avatar
    Join Date
    11-27-2008
    Location
    South Australia
    MS-Off Ver
    MS Office 2007
    Posts
    253
    Now that make sense. Thank you for useful added information. I'm still learning the hard way, cheers mate.

+ 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