View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
acampbell acampbell is offline
external usenet poster
 
Posts: 20
Default Placement of variables in called sub causes code to fail

Can somebody help me understand why the following code, in sub1 fails
to run but the modifcations to the called sub below that does run? I
was getting "Argument not optional" error.

Alan

Sub1() 'in module1
.....other routines
If bla bla then
Exporttofile 'in module2
Else
.... other routines

Sub Exporttofile (fName As String, Sep As String, SelectionOnly As
Boolean)
code...

Modified Exporttofile:

Sub Exporttofile()
Dim fName As String
Dim Sep As String
Dim SelectionOnly As Boolean