LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 39
Default 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
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Duplicate declaration in scope Hebs Excel Programming 2 January 10th 12 07:48 PM
"Duplicate declaration in current scope" during edit and continue Greg Lovern Excel Programming 1 April 7th 11 10:33 PM
combining macros - compile error: duplicate declaration in current scope J.W. Aldridge Excel Programming 1 December 9th 06 03:50 PM
Macro / Compile Error / Duplicate Declaration carl Excel Worksheet Functions 1 June 29th 05 08:55 PM
duplicate declaration [email protected] Excel Programming 1 March 1st 05 02:03 AM


All times are GMT +1. The time now is 02:53 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"