Results 1 to 14 of 14

Dates not being read correctly

Threaded View

  1. #1
    Registered User
    Join Date
    08-09-2023
    Location
    London
    MS-Off Ver
    o365
    Posts
    6

    Dates not being read correctly

    Hi.

    I have code that used to work on previous versions of Office but doesn't seem to now and I can't work out why.

    I have a spreadsheet with various columns, one of which is dates, formatted as dates (Long Date specifically), then a macro that reads each line and creates a recurring outlook appointment for each one. However, the result is all the details are correct on the Outlook appointment, except it's creating them all today (whichever day you run it). The portion of code that is not quite working is below. It's the Start and End parameters that are just being ignored or overridden.

    Is anyone able to shed any light please?

        With olAppt
            Set oPat = .GetRecurrencePattern
            oPat.RecurrenceType = olRecursYearly
            .Start = DateValue(Cells(i, 3)) + TimeValue("9:00:00")
            .End = DateValue(Cells(i, 3)) + TimeValue("9:01:00")
            .Subject = Cells(i, 1) + " " + Cells(i, 2) + " is on " & Cells(i, 3) & " since " & Cells(i, 4)
            '.Location = Cells(i, 2)
            .Body = .Subject
            .BusyStatus = olFree
            .ReminderMinutesBeforeStart = 10080
            .ReminderSet = True
            '.Categories = Cells(i, 4)
            '.IsRecurring
            .Save
        End With
    Last edited by AliGW; 08-10-2023 at 12:37 AM. Reason: Code tags added - please review the forum rules.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Unable to read a number. All text is reading correctly
    By JChandler8314 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-29-2020, 07:10 AM
  2. [SOLVED] VBA not filtering dates correctly
    By matrixpom in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-15-2019, 12:59 AM
  3. Convert European dates to Excel-read dates
    By thepinkgeologist in forum Excel General
    Replies: 1
    Last Post: 09-21-2015, 10:33 AM
  4. Replies: 11
    Last Post: 07-05-2015, 12:46 PM
  5. [SOLVED] Excel 2007 : 2007 Files, not being read correctly by 2010
    By simon@natsow.co.za in forum Excel General
    Replies: 1
    Last Post: 04-11-2012, 11:00 AM
  6. Dates not formatting correctly
    By calsonicgtr in forum Excel General
    Replies: 1
    Last Post: 08-22-2011, 12:44 PM
  7. Read clipboard doesn't work correctly
    By marmotinchen in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-04-2011, 08:16 AM

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