Write Range: Not a legal OleAut date

Hi Team,

I ran a query and am putting the output datatable in an excel file. It was working fine all these days. Today suddenly this error : Write Range: Not a legal OleAut date. popped up…
Has it got something to do with size of the file… it was 14MB today… daily it’s usually 3MB…
Or is the issue wrt to date? what is it and why didn’t it pop up previously ?

Hi @hss

try this

DateTime Date = DateTime.FromOADate(Your Value replace here)

Thanks
Ashwin S

@AshwinS2

How do i retrieve the datatable column??which is already populated from the sql output.

Hi @hss

try within for each and try to print the values based on Datatable given in Execute query cmd

Thanks
Ashwin S