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: 553
Default Passing sheet names to an array

I am passing sheet names to an array. 4 sheets from one open file and 4
sheets from another open file. I open the second file in the routine using
the GetOpenFile stmt. I have named the sheets in VBA. What I am trying to
do is pass the Name property of the named sheet to the array as seen below.
However, the first set of names are causing a "Run Time 424 Error" when I try
to pass them to the array called ExportSheetNameArray. Now I know that the
names exist by looking at the project properties of each sheet in both files
through the properties and project windows. When I check in the immediate
window I only get names for the second set of names (seems consistent withthe
error I am getting). But why. Why do the second set pass properly to the
second array (ImportSheetNameArray) and not the first set
(ExportSheetNameArray)?

?SecExpSht.Name
?UnsecExpSht.Name
?CarExpSht.Name
?RetExpSht.Name

?SecImpSht.Name
Secured Import Sheet
?UnsecImpSht.Name
Unsecured Import Sheet
?CarImpSht.Name
Cars Import Sheet


Dim ExportSheetNameArray(0 To 3)
Dim ImportSheetNameArray(0 To 3)

FName = Application.GetOpenFilename("Excel Files (*.xls), *.xls")
Workbooks.Open Filename:=FName

'Pass names of 4 export sheets to array
ExportSheetNameArray(0) = SecExpSht.Name
ExportSheetNameArray(1) = UnsecExpSht.Name
ExportSheetNameArray(2) = CarExpSht.Name
ExportSheetNameArray(3) = RetExpSht.Name

'Pass names of 4 import sheets to array
ImportSheetNameArray(0) = SecImpSht.Name
ImportSheetNameArray(1) = UnsecImpSht.Name
ImportSheetNameArray(2) = CarImpSht.Name
ImportSheetNameArray(3) = RetImpSht.Name
 
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
XL2007 and array of sheet names? Jack Sheet Excel Discussion (Misc queries) 0 August 5th 06 02:57 PM
Array of all selected sheet names? quartz[_2_] Excel Programming 13 October 5th 05 08:52 AM
Passing Worksheet Names as Variables francd1 Excel Programming 3 June 29th 05 11:30 AM
Load an array with Sheet names S G Booth Excel Programming 6 March 2nd 05 08:48 PM
Sheet Names Array Rocky McKinley Excel Programming 2 June 9th 04 11:49 PM


All times are GMT +1. The time now is 03:33 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"