View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming,microsoft.public.access.formscoding,microsoft.public.access.externaldata
Dale Fye Dale Fye is offline
external usenet poster
 
Posts: 169
Default Bypassing the Security Warning when opening Excel file

James, I'm running Office 2003.

I've had this problem with dates in the past.

In this instance the Excel field is Task, and is formatted as text, although
the numbers look like:

1.1
1.1.1
1.1.2
1.2
1.2.1
1.1.2

Interestingly, the numbers I am having difficulty with are 1.1 and 1.2; the
others are formatted properly.

Dale

"Minton M" wrote in message
...
On Jan 7, 7:55 am, "Dale Fye" wrote:
I've got an Access application that has to read some data (and perform
some
manipulation of it) from several Excel files.

Unfortunately, when I either import or link the Excel spreadsheets,
Access
is misinterpreting a field type and I am losing data. Because of this, I
am
using automation to open Excel and read the records one row at a time,
doing
the appropriate data type conversions. Unfortunately, I keep getting the
annoying macro security warning whenever I open the Excel files. Is
there a
way to bypass this warning and disable the Excel macros programmatically?


You didn't mention which version of Excel you're using - the security
has changed in each version. I would recommend solving the first
problem - the data type issue. Access often does this if one fo the
fields in a column changes type unexpectedly. This most often happens
with dates - frequently, they'll be a text format field where someone
has frigged up the date to look like a date format and that will cause
the import to blow up.

-- James