View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Chip Pearson Chip Pearson is offline
external usenet poster
 
Posts: 7,247
Default referring to worksheet

Karen,

Does the strsheetname value have the ".xls" extension? It should if it
doesn't.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
(email address is on the web site)

"KarenH" wrote in message
...
Why would I get a "subscript out of range" error on the following?

? workbooks(strsheetname).Sheets.Count

This is within a procedure where strsheetName is a string variable passed
in
that is the name of the workbook.

Thanks.