View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default run-time error '13'

Evaluate doesn't work with closed workbooks.

The IF test has to be in the Formula you put in the cell.

--
Regards,
Tom Ogilvy


"Tim" wrote in message
...
Hi folks,

When I ran the following code, I got "run-time error '13'. Type mismatch"

..
Could anyone tell me how to fix it?

If Evaluate("'" & strFolder & "[" & strFile & "]" & "Data" & "'!C8") =
"" Then
.Value = ""
Else
.Value = "='" & strFolder & "[" & strFile & "]" & "Data" & "'!C8"
.Value = .Value
End If


Thanks in advance.

Tim.