Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Tim Tim is offline
external usenet poster
 
Posts: 408
Default run-time error 13

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.

  #2   Report Post  
Posted to microsoft.public.excel.programming
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.



  #3   Report Post  
Posted to microsoft.public.excel.programming
Tim Tim is offline
external usenet poster
 
Posts: 408
Default run-time error '13'

Hi Tom,

Could you show me the code?

Thanks.

Tim.

"Tom Ogilvy" wrote:

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.




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default run-time error '13'

end result

=if(A1="","",A1)

so

ActiveCell.Formula = "=if(A1="""","""",A1)"

Obviously you would replace A1 with the string you are building.

--
Regards,
Tom Ogilvy

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

Could you show me the code?

Thanks.

Tim.

"Tom Ogilvy" wrote:

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.






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
Visual Basic Error Run Time Error, Type Mismatch Meg Partridge Excel Discussion (Misc queries) 12 September 10th 08 06:10 PM
Run time error 1004, General ODBC error [email protected] New Users to Excel 0 September 19th 05 01:41 AM
Application Run Time Error 1004 and Stack Error ExcelMonkey[_190_] Excel Programming 9 February 11th 05 04:48 PM
Befuddled with For Next Loop ------ Run - Time Error '13' Type Mismatch Error rdavis7408 Excel Programming 1 August 25th 04 03:54 AM
Code Error - Run Time Error 5 (Disable Cut, Copy & Paste) Tim[_36_] Excel Programming 4 April 23rd 04 02:53 AM


All times are GMT +1. The time now is 12:13 AM.

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

About Us

"It's about Microsoft Excel"