ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Date Problem (https://www.excelbanter.com/excel-programming/373092-date-problem.html)

hon123456

Date Problem
 
Dear all,

When I passed a date value from Recordset to Excel cell
cell , when the date is 1899/1/1
The VBA complains " Applicaiton Object defined error".

The code is as follows

Sheet2.Cells(i + 5, j + 1) = rs.Fields(j).Value

If rs.fields(j).value equals to 1899/1/1, the error
occured. If I change the rs.fields(j).value to

2000/1/1, then there is no error.

What happened? How to adjust excel to accept the date
1899/1/1?

Thanks.


Leo Heuser

Date Problem
 
"hon123456" skrev i en meddelelse
ups.com...
Dear all,

When I passed a date value from Recordset to Excel cell
cell , when the date is 1899/1/1
The VBA complains " Applicaiton Object defined error".

The code is as follows

Sheet2.Cells(i + 5, j + 1) = rs.Fields(j).Value

If rs.fields(j).value equals to 1899/1/1, the error
occured. If I change the rs.fields(j).value to

2000/1/1, then there is no error.

What happened? How to adjust excel to accept the date
1899/1/1?

Thanks.


Excel only accepts dates from 1900/1/1 and forward.

--
Best regards
Leo Heuser

Followup to newsgroup only please.




All times are GMT +1. The time now is 08:32 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com