ability to embed a macro within a csv

N

n30

situation: I am created a sceduled task within an ACCESS
dB to export out information to a .csv network file share.
The problem is that the date field is illegible it appears
in date-time format and when opened appears as
2.00512E+13. The ACCESS export is always writing over the
same file.

Is it possible to create a macro within this network file
share .csv which will format the columns, perform a LEFT
(datefield,8) on the date field trimming off the time so
that just the date appears as 20051231 and then format
this date field to appear as 12-31-2005 and then sort the
entire worksheet by date while assigning this macro to a
smiley face as a custom command on the toolbar also with
autoexec feature.

The objective being that all users throughout the network
will have a shortcut on their desktop pointing to the
network .csv file share so the macro is invoked upon
opening the file and the user can then look at a file
which makes sense vis-a-vis the date field.

Note: I attempted this but I was not able to save the
macro to the .csv. WHen I reopened the .csv I receive an
error message that the macro created cannot be found.

Thank you very much in advance!
 
G

Guest

It seems to me that if the dates in the Access generated CSV were formatted
in m/d/yyyy format you wouldn't run into the problem. Excel would translate
the date-like text into actual Excel dates, then you wouldn't need any kind
of macro.

Is there a reason that can't be done?

Regards,
Ron
 
G

Guest

This has not been possible to date but I will get back to
you after I recreate the ACCESS .csv export with actual
data. Unfortunately I do not have the actual export with
me and do not remember the format ACCESS is exporting out
the date-time in the csv file.

Thank you for such a quick response!
 
E

Earl Kiosterud

A csv file is not application-specific, and contains only text anyway, by
definition. So there's no way for a macro to be in it. This sounds like
Access is writing the date in a format that your Excel doesn't recognize as
a date (depends on your regional settings).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top