Duplicate declaration in current scope, but not so
Coded a Sub to dump a variant array to a sheet and optionally apply some
formatting to the sheet range. The code in the Sub is not the problem, but there is a problem with the arguments in the Sub:
Sub ArrayToSheet(vArray As Variant, _
Optional oSheet As Worksheet, _
Optional oFirstCell As Range, _
Optional bFreezeScreen As Boolean, _
Optional bFormatRange As Boolean, _
Optional bUnderLineHeaders As Boolean, _
Optional strHeadersCSV As String, _
Optional bUnderLineHeaders As Boolean, _
Optional lBottomBorderFirstColumnInRange As Long = -1, _
Optional lBottomBorderLastColumnInRange As Long = -1, _
Optional lMarkingRowsColumnInRange As Long = -1, _
Optional lBorderThickness As Long = xlThin, _
Optional vBottomArray As Variant)
It gives me the error message: Duplicate declaration in current scope, highlighting this bit:
Sub ArrayToSheet(vArray As Variant, _
But this is not the case at all. I even get the same message if I put this Sub in a completely new workbook with no other code at all. Then, strangely, if I take some arguments off that Sub then eventually the error message will disappear.
I rebuild the workbook in case there was some corruption, but didn't help.
Any idea what could be the problem here?
This is Office 2007 on Windows 7.
RBS
|