LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 172
Default problem with type mismatch error

Running the following code produces a type mismatch error when the
line with the ExecuteExcel4Macro is reached. But if the code is re-run
again with no changes the error does not occur.

I've done some web searching and found some suggestions that I've
tried (Dim arg as Variant and double quotes for example) but nothing
has eliminated the error yet.

If all else fails I'll do an on error resume next but first I'd like
to see if the problem can be corrected. Any ideas?

Thanks



Dim arg As Variant

Application.ScreenUpdating = False

Max_Row = 500
Path = "'C:/"
file = "[Analysis.xls]"
Sheet = "Pn Summary'!"
string = Path & file & Sheet

source_c = 1
dest_c = 3
For r = 1 To Max_Row
a = Cells(r + 4, source_c).Address
arg = string & Range(a).Range("A1").Address(, , xlR1C1)
Cells(r, dest_c) = UCase(ExecuteExcel4Macro(arg))
If Cells(r, dest_c) = 0 Then Cells(r, dest_c).ClearContents
Next r


John Keith

 
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
Array problem: Key words-Variant Array, single-element, type mismatch error davidm Excel Programming 6 November 9th 05 05:54 AM
Array problem: Key words-Variant Array, single-element, type mismatch error davidm Excel Programming 1 November 8th 05 04:21 AM
Help: Compile error: type mismatch: array or user defined type expected lvcha.gouqizi Excel Programming 1 October 31st 05 08:20 PM
Type mismatch error problem when dealing with Strings David Goodall[_2_] Excel Programming 4 June 30th 05 01:40 PM


All times are GMT +1. The time now is 10:20 PM.

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"