# Bravo! I Got the Answer!

Posted by Tommy_Lee on January 14, 1999 at 19:26:53:

In Reply to: 如何得到一个 excel file 中所有的sheet的数量及name??? posted by Tommy Lee on January 13, 1999 at 20:33:13:

I have found the solution as following:

'Open the OLE Automation
Set myExcel=GetObject(XFile)
'Open the ExcelFile U want
myExcel.Parent.Windows(XFile).Active
'Getting the Number of Sheet
stCount=my.Application.sheets.Count
'make a loop to got the sheet's Name
For i=1 To sheetCount
myExcel.Application.sheets(i).Select
stName(i)=myExcel.application.activesheet.Name
Next i

Then I got the all sheet's name

It is so woundful to know this website......
I hope that everyone appreciates it like me!

Follow Ups: