View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Benjamin[_4_] Benjamin[_4_] is offline
external usenet poster
 
Posts: 3
Default Type mismatch when calling sub with array of worksheets argument

Hi,

I have a Sub with the following signatu

Sub SendSheet( _
ByRef awksSheets() As Worksheet, _
ByVal strReceiver As String, _
ByVal strSubject As String, _
ByVal strBody As String)

When I call it as follows

SendSheet Array(Workheets(1),Worksheets(2)), _
", "Subject", "Text body"

I get the error "Compile error: Type mismatch: array or user-defined
type expected". Why is that? How do I have to call this Sub?

Any pointers are greatly appreciated.

Cheers, Benjamin