+ Reply to Thread
Results 1 to 2 of 2

This particular Date is causing problems

  1. #1
    Registered User
    Join Date
    10-04-2017
    Location
    Madrid
    MS-Off Ver
    2010
    Posts
    1

    This particular Date is causing problems

    So our clients have to turn in Excels with Date fields among others, when loading one of these into my program suddenly my IDE throws an exception. I debug and find out that a particular cell on a Date column is responsible: 22/10/2014.

    The cell is formatted the same as all other date cells, and the actual value doesn't (apparently) differ in format from the others in the same Excel, but somehow my program can't format it to 22-oct-2014, it will fetch 22/10/2014 literally as a String, leading to a crash. Too big of a thing to control the issue inside the logic.

    The question would be, IS THERE ANY CHAR IN A KEYBOARD THAT COULD MAKE MY PROGRAM NOT TO INTERPRET THE VALUE AS A DATE, BUT STILL OVERCOME EXCEL'S CELL VALIDATION? If not, please you are welcome to throw in some ideas.

    Thank you for the support.

  2. #2
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: This particular Date is causing problems

    see attached workbook which may help you identify the character
    - formulas =CHAR and =CODE applied to discover cell contents
    - it is not perfect (leading apostrophe ' is ignored by =CODE )
    - see A1 which begins with apostrophe space apostrophe
    - but B1 thinks that the space is the first character
    - even LEN(A1) ignores it and tells us that there are 12 characters when there are 13
    - also notice that if we concatenate the characters from a cell which contains a valid date we get a date value (see formula in cell M6)

    You could edit the "bad" cell in the Formula Bar and clear anything before the day value
    - there may be a "big" space or a "small" space character or an apostrophe (or something else!)
    - the space may not be visible but you can delete it if you put the cursor in the correct place
    Attached Files Attached Files
    Click *Add Reputation to thank those who helped you. Ask if anything is not clear

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Object Suddenly Causing Problems
    By emp1346 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-22-2015, 04:48 PM
  2. Read-Only causing saving problems
    By johncassell in forum Excel General
    Replies: 0
    Last Post: 04-07-2009, 04:37 AM
  3. [SOLVED] Macro conflict causing problems
    By Ken McLennan in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-13-2006, 09:20 AM
  4. Highlighting row causing problems with other progarms.
    By chuckm in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-11-2006, 04:25 PM
  5. Rand () causing Problems.
    By JCary in forum Excel General
    Replies: 1
    Last Post: 03-06-2006, 06:40 PM
  6. Is Excel causing me system problems?
    By Sandra in forum Excel General
    Replies: 1
    Last Post: 04-07-2005, 05:06 PM
  7. Macro causing print problems
    By johnkiddier in forum Excel General
    Replies: 0
    Last Post: 01-07-2005, 06:27 AM

Tags for this Thread

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