Type Mismatch on Date

  • Thread starter Thread starter Cameron
  • Start date Start date
C

Cameron

Hello folks,

Looking for some help here, I've tried searching as I suspect this is
a common problem, but I haven't been able to come up with an answer.

I've inherited an excel file that links to data in access. It's got a
macro that runs and it says there's a type mismatch on this command:

MinDate = .Cells(3, 1).Value

If I go into the debugger and just start the macro up again, it runs
fine.

So my problem is with that cell. In that cell is this:

=Msaccess|'S:\PROD&QA\VA_proj\DATABASE\vaprog.mdb;Table Dateform
Table'!All

When the macro tries to get the value from that cell, there is a #N/A
as the value. After the debugger opens, the value has changed to
12/1/2003, or a date.

Any suggestions?

thanks,
Cameron
 
Cameron said:
I've inherited an excel file that links to data in access. It's got a
macro that runs and it says there's a type mismatch on this command:

MinDate = .Cells(3, 1).Value

Looks like the macro is running before the data has arrived.

Maybe something like this

Do While WorksheetFunction.ISNA(.Cells(3,1).Value)
DoEvents
Loop
MinDate = .Cells(3, 1).Value

Bill Manville
MVP - Microsoft Excel, Oxford, England
No email replies please - reply in newsgroup
 
Back
Top