I want a macro to save the report as an excel file but when i test the macro, it tells me there's a syntax error on the SaveReport line.
My macro script is as follows:
Sub saveasexcel()
Dim Sitenm as string
Dim Filename as String
Dim Num as variant
Sitenm = Field("site")
Filename = "C:\Documents\UDA-"+Sitenm
Num=2
SaveReport (Filename,Num)
End Sub
I've tried using:
SaveReport (Filename,2)
And I've tried using other data types for the variable "Num", but these only lead to a second error: "Type mismatch, parameter 1 in subprogram SaveReport"
What am I missing?
Any and all help greatly appreciated!
My macro script is as follows:
Sub saveasexcel()
Dim Sitenm as string
Dim Filename as String
Dim Num as variant
Sitenm = Field("site")
Filename = "C:\Documents\UDA-"+Sitenm
Num=2
SaveReport (Filename,Num)
End Sub
I've tried using:
SaveReport (Filename,2)
And I've tried using other data types for the variable "Num", but these only lead to a second error: "Type mismatch, parameter 1 in subprogram SaveReport"
What am I missing?
Any and all help greatly appreciated!