Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Type Mismatch on Date

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 473
Default Type Mismatch on Date

Cameron wrote:
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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Type Mismatch on Date

That works, thanks Bill!!

Bill Manville wrote in message
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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Type mismatch... George[_4_] Excel Discussion (Misc queries) 7 December 19th 07 12:20 PM
Type Mismatch [email protected] Excel Worksheet Functions 1 May 16th 07 03:29 PM
Sumif from VBA Type mismatch mdalamers via OfficeKB.com Excel Worksheet Functions 3 March 7th 07 11:56 PM
type mismatch--how to fix rroach Excel Discussion (Misc queries) 2 July 14th 05 06:23 PM


All times are GMT +1. The time now is 09:40 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"