View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Peter T Peter T is offline
external usenet poster
 
Posts: 5,600
Default Theory behind passing workbook

"kris" wrote in message
...
<snip
Thanks Chip Pearson for ur very good example, but why workbooks can't be
passed as Byref. the following code is showing "ByRef Argument type

mismatch"

Function func1(ByRef S1 As Workbook)
----------------
end Function

Sub ff()
dim D as workbook
set D=Application.WorkBook.open("C:\D.xls")
call func1(D)
end sub


That works fine for me, subject changing the typo WorkBook to 'WorkBooks'.

Also try simply passing the ActiveWorkbook

Regards,
Peter T