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: 153
Default Not getting "argument type mismatch"

Hello,

When I compile the following code, I get a "Byref argument type mismatch", which is exactly what I'd expect to get.

Sub test1()
Dim l As Long
l = 3
test2 l
End Sub

Sub test2(s As String)
'do someting
End Sub

So my question is, why don't I get a compile error on this bit of code? I thought my Excel had become corrupted, but I tried it on other machines, same results - no compile error.

Sub test1()
Dim r As Range
Set r = Range("a1")
test2 r
End Sub

Sub test2(w As Worksheet)
'do someting
End Sub

Thank you,

Regards

DaveU
 
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
"ByRef argument type mismatch" error Robert Crandal Excel Programming 2 December 27th 09 11:29 AM
"Compile Error: ByRef argument type mismatch" when calling my function from another module ker_01 Excel Programming 2 August 14th 08 03:53 PM
HELP "ByRef Argument Type Mismatch" RocketMan[_2_] Excel Programming 6 June 7th 07 07:00 PM
"ByRef argument type mismatch" Error Baapi[_4_] Excel Programming 2 September 17th 05 12:47 AM
"FIND" generates "Type mismatch" error quartz[_2_] Excel Programming 5 November 16th 04 03:29 PM


All times are GMT +1. The time now is 09:15 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"