Hello,
I'm trying to export data to an Excel spreadsheet (using VBA), which usually works fine. But now I have the following problem:
When I try to export a date, Excel defines it's own field property and mask to it. And this means a date notation I don't wanna use!
So, I've tried to convert the date to a string or give it a certain date format (using VBA, works fine in Access), but when I export it to Excel the format keeps changing
How can I avoid this by letting Excel know that the date has to be treated as plain text (in the field properties)????
Here is my code:
Also tried (didn't work either):
Any help will be greatly appreciated!
I'm trying to export data to an Excel spreadsheet (using VBA), which usually works fine. But now I have the following problem:
When I try to export a date, Excel defines it's own field property and mask to it. And this means a date notation I don't wanna use!
So, I've tried to convert the date to a string or give it a certain date format (using VBA, works fine in Access), but when I export it to Excel the format keeps changing
How can I avoid this by letting Excel know that the date has to be treated as plain text (in the field properties)????
Here is my code:
Code:
Dim ExDate as String
Set ExcelSheet = CreateObject("Excel.Sheet")
ExcelSheet.Application.Visible = True
ExDate = Format(now, "dd\-mm\-yyyy")
ExcelSheet.ActiveSheet.cells(1, 1).Value = ExDate
Also tried (didn't work either):
Code:
ExcelSheet.ActiveSheet.cells(1, 1).Value = Format(ExDate, "dd\-mm\-yyyy")
Any help will be greatly appreciated!