Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 272
Default Mac Excel for 2004 macro date problem

I am running the following portion of a macro that should return the date for
the end of the previous month:

dt = Format(EoMonth(Date, -1), "mmmm d, yyyy")

This works correctly when I first open the workbook and run the macro for
the first time. However, if I keep the workbook open and run the macro
again, it will return the date that's four years and one day too early. This
appears to be a problem with the 1904 Mac date, but I have unchecked the 1904
date system option in the excel preferences for this workbook. Can I add a
line of code to set the date for the application to not use 1904, so it runs
consistently?
Thanks!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Mac Excel for 2004 macro date problem


Hello Lori

Add this line to your to your macro code..

ActiveWorkbook.Date1904 = Fals

Sincerely
Leith Ros

--
Leith Ros
-----------------------------------------------------------------------
Leith Ross's Profile: http://www.excelforum.com/member.php...fo&userid=1846
View this thread: http://www.excelforum.com/showthread.php?threadid=49776

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Protecting a Macro on a Mac using Excel 2004 [email protected] Excel Worksheet Functions 1 October 20th 08 08:18 PM
Date Picker for Mac Excel 2004 [email protected] Excel Programming 0 December 6th 05 07:17 PM
I can't format 01/19/2004 to read January 19, 2004, please help!! paulonline66 Excel Discussion (Misc queries) 5 June 17th 05 04:54 AM
Excel 2004 Can't Disable Auto_Open Macro. What Now? SidBord Excel Programming 4 July 9th 04 08:09 PM
Use VBA to replace 2002 by 2004 in Date Leo Elbertse Excel Programming 7 December 26th 03 11:49 AM


All times are GMT +1. The time now is 04:14 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"