Those quotes are needed only if there are spaces in the sheet name. I
usually put in a code step that tests for this before putting the quotes
around the sheet name, but I apparently left that step out of the post when
I pasted it into my message. If you wanted to use this extra test, you can
insert this line of code right after the line "strSheets(lngCount) =
xls.Worksheets(lngCount + 1).Name":
If InStr(strSheets(lngCount), " ") > 0 Then strSheets(lngCount) = "'" &
strSheets(lngCount) & "'"
Glad you got it to work!
--
Ken Snell
<MS ACCESS MVP>
Ron said:
You are right. I only got the first sheet. Even worse I got it twice
since there are 2 sheets in my array.
I messed around with the code a bit and got it working. I got rid of the
single quotes where the sheet is named. Below is what I have now. The
cdlg.getname variable holds the path retrieved by the Common Dialog control.
Thanks again for all your help.