View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Norman Jones Norman Jones is offline
external usenet poster
 
Posts: 5,302
Default How to get a sheets name or list.

Hi Simon,

The suggested code will not operate on a closed workbook.

If your intention is that the workbook should not be seen, perhaps you could
turn off screen updating, open the requisite workbook, list the sheet names,
close the workbook and then restore screen updating.

---
Regards,
Norman



"Simon Chang" wrote in message
...
Actually, I use "Application.GetOpenFilename" code to browse my workbooks
and pick any of them (but not to open them) which is from there I tries to
retrieve the sheets name. So I tried your codes by adding my codes but it
not respond to my code.

This is what I've tried:

Sub ShowSheetList()
'Jim Rech
mybook = Application.GetOpenFilename("Pick any workbook (*.xls), *.xls",
vbApplicationModal, "Good Luck")

On Error Resume Next
If mbook.Sheets.Count <= 16 Then
Application.CommandBars("Workbook Tabs"). _
ShowPopup 500, 225
Else
Application.CommandBars("Workbook Tabs"). _
Controls("More Sheets...").Execute
End If
On Error GoTo 0
End Sub

Your respond is on my appreciations and thanks in advance.